<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="Content-Style-Type" content="text/css" />
  <meta name="generator" content="pandoc" />
  <meta name="author" content="John MacFarlane" />
  <meta name="date" content="2017-01-29" />
  <title>Pandoc User’s Guide</title>
  <style type="text/css">code{white-space: pre;}</style>
</head>
<body>
<div id="header">
<h1 class="title">Pandoc User’s Guide</h1>
<h2 class="author">John MacFarlane</h2>
<h3 class="date">January 29, 2017</h3>
</div>
<div id="TOC">
<ul>
<li><a href="#synopsis">Synopsis</a></li>
<li><a href="#description">Description</a><ul>
<li><a href="#using-pandoc">Using <code>pandoc</code></a></li>
<li><a href="#creating-a-pdf">Creating a PDF</a></li>
</ul></li>
<li><a href="#options">Options</a><ul>
<li><a href="#general-options">General options</a></li>
<li><a href="#reader-options">Reader options</a></li>
<li><a href="#general-writer-options">General writer options</a></li>
<li><a href="#options-affecting-specific-writers">Options affecting specific writers</a></li>
<li><a href="#citation-rendering">Citation rendering</a></li>
<li><a href="#math-rendering-in-html">Math rendering in HTML</a></li>
<li><a href="#options-for-wrapper-scripts">Options for wrapper scripts</a></li>
</ul></li>
<li><a href="#templates">Templates</a><ul>
<li><a href="#variables-set-by-pandoc">Variables set by pandoc</a></li>
<li><a href="#language-variables">Language variables</a></li>
<li><a href="#variables-for-slides">Variables for slides</a></li>
<li><a href="#variables-for-latex">Variables for LaTeX</a></li>
<li><a href="#variables-for-context">Variables for ConTeXt</a></li>
<li><a href="#variables-for-man-pages">Variables for man pages</a></li>
<li><a href="#using-variables-in-templates">Using variables in templates</a></li>
</ul></li>
<li><a href="#pandocs-markdown">Pandoc’s Markdown</a><ul>
<li><a href="#philosophy">Philosophy</a></li>
<li><a href="#paragraphs">Paragraphs</a></li>
<li><a href="#headers">Headers</a><ul>
<li><a href="#setext-style-headers">Setext-style headers</a></li>
<li><a href="#atx-style-headers">ATX-style headers</a></li>
<li><a href="#header-identifiers">Header identifiers</a></li>
</ul></li>
<li><a href="#block-quotations">Block quotations</a></li>
<li><a href="#verbatim-code-blocks">Verbatim (code) blocks</a><ul>
<li><a href="#indented-code-blocks">Indented code blocks</a></li>
<li><a href="#fenced-code-blocks">Fenced code blocks</a></li>
</ul></li>
<li><a href="#line-blocks">Line blocks</a></li>
<li><a href="#lists">Lists</a><ul>
<li><a href="#bullet-lists">Bullet lists</a></li>
<li><a href="#the-four-space-rule">The four-space rule</a></li>
<li><a href="#ordered-lists">Ordered lists</a></li>
<li><a href="#definition-lists">Definition lists</a></li>
<li><a href="#numbered-example-lists">Numbered example lists</a></li>
<li><a href="#compact-and-loose-lists">Compact and loose lists</a></li>
<li><a href="#ending-a-list">Ending a list</a></li>
</ul></li>
<li><a href="#horizontal-rules">Horizontal rules</a></li>
<li><a href="#tables">Tables</a></li>
<li><a href="#metadata-blocks">Metadata blocks</a></li>
<li><a href="#backslash-escapes">Backslash escapes</a></li>
<li><a href="#smart-punctuation">Smart punctuation</a></li>
<li><a href="#inline-formatting">Inline formatting</a><ul>
<li><a href="#emphasis">Emphasis</a></li>
<li><a href="#strikeout">Strikeout</a></li>
<li><a href="#superscripts-and-subscripts">Superscripts and subscripts</a></li>
<li><a href="#verbatim">Verbatim</a></li>
<li><a href="#small-caps">Small caps</a></li>
</ul></li>
<li><a href="#math">Math</a></li>
<li><a href="#raw-html">Raw HTML</a></li>
<li><a href="#raw-tex">Raw TeX</a></li>
<li><a href="#latex-macros">LaTeX macros</a></li>
<li><a href="#links">Links</a><ul>
<li><a href="#automatic-links">Automatic links</a></li>
<li><a href="#inline-links">Inline links</a></li>
<li><a href="#reference-links">Reference links</a></li>
<li><a href="#internal-links">Internal links</a></li>
</ul></li>
<li><a href="#images">Images</a></li>
<li><a href="#spans">Spans</a></li>
<li><a href="#footnotes">Footnotes</a></li>
<li><a href="#citations">Citations</a></li>
<li><a href="#non-pandoc-extensions">Non-pandoc extensions</a></li>
<li><a href="#markdown-variants">Markdown variants</a></li>
<li><a href="#extensions-with-formats-other-than-markdown">Extensions with formats other than Markdown</a></li>
</ul></li>
<li><a href="#producing-slide-shows-with-pandoc">Producing slide shows with pandoc</a><ul>
<li><a href="#structuring-the-slide-show">Structuring the slide show</a></li>
<li><a href="#incremental-lists">Incremental lists</a></li>
<li><a href="#inserting-pauses">Inserting pauses</a></li>
<li><a href="#styling-the-slides">Styling the slides</a></li>
<li><a href="#speaker-notes">Speaker notes</a></li>
<li><a href="#frame-attributes-in-beamer">Frame attributes in beamer</a></li>
</ul></li>
<li><a href="#creating-epubs-with-pandoc">Creating EPUBs with pandoc</a><ul>
<li><a href="#epub-metadata">EPUB Metadata</a></li>
<li><a href="#linked-media">Linked media</a></li>
</ul></li>
<li><a href="#literate-haskell-support">Literate Haskell support</a></li>
<li><a href="#syntax-highlighting">Syntax highlighting</a></li>
<li><a href="#custom-styles-in-docx-output">Custom Styles in Docx Output</a></li>
<li><a href="#custom-writers">Custom writers</a></li>
<li><a href="#authors">Authors</a></li>
</ul>
</div>
<h1 id="synopsis">Synopsis</h1>
<p><code>pandoc</code> [<em>options</em>] [<em>input-file</em>]…</p>
<h1 id="description">Description</h1>
<p>Pandoc is a <a href="https://www.haskell.org">Haskell</a> library for converting from one markup format to another, and a command-line tool that uses this library. It can read <a href="http://daringfireball.net/projects/markdown/">Markdown</a>, <a href="http://commonmark.org">CommonMark</a>, <a href="https://michelf.ca/projects/php-markdown/extra/">PHP Markdown Extra</a>, <a href="https://help.github.com/articles/github-flavored-markdown/">GitHub-Flavored Markdown</a>, <a href="http://fletcherpenney.net/multimarkdown/">MultiMarkdown</a>, and (subsets of) <a href="http://redcloth.org/textile">Textile</a>, <a href="http://docutils.sourceforge.net/docs/ref/rst/introduction.html">reStructuredText</a>, <a href="http://www.w3.org/html/">HTML</a>, <a href="http://latex-project.org">LaTeX</a>, <a href="https://www.mediawiki.org/wiki/Help:Formatting">MediaWiki markup</a>, <a href="http://twiki.org/cgi-bin/view/TWiki/TextFormattingRules">TWiki markup</a>, <a href="https://www.haskell.org/haddock/doc/html/ch03s08.html">Haddock markup</a>, <a href="http://dev.opml.org/spec2.html">OPML</a>, <a href="http://orgmode.org">Emacs Org mode</a>, <a href="http://docbook.org">DocBook</a>, <a href="http://txt2tags.org">txt2tags</a>, <a href="http://idpf.org/epub">EPUB</a>, <a href="http://en.wikipedia.org/wiki/OpenDocument">ODT</a> and <a href="https://en.wikipedia.org/wiki/Office_Open_XML">Word docx</a>; and it can write plain text, <a href="http://daringfireball.net/projects/markdown/">Markdown</a>, <a href="http://commonmark.org">CommonMark</a>, <a href="https://michelf.ca/projects/php-markdown/extra/">PHP Markdown Extra</a>, <a href="https://help.github.com/articles/github-flavored-markdown/">GitHub-Flavored Markdown</a>, <a href="http://fletcherpenney.net/multimarkdown/">MultiMarkdown</a>, <a href="http://docutils.sourceforge.net/docs/ref/rst/introduction.html">reStructuredText</a>, <a href="http://www.w3.org/TR/xhtml1/">XHTML</a>, <a href="http://www.w3.org/TR/html5/">HTML5</a>, <a href="http://latex-project.org">LaTeX</a> (including <a href="https://ctan.org/pkg/beamer"><code>beamer</code></a> slide shows), <a href="http://www.contextgarden.net/">ConTeXt</a>, <a href="http://en.wikipedia.org/wiki/Rich_Text_Format">RTF</a>, <a href="http://dev.opml.org/spec2.html">OPML</a>, <a href="http://docbook.org">DocBook</a>, <a href="http://opendocument.xml.org">OpenDocument</a>, <a href="http://en.wikipedia.org/wiki/OpenDocument">ODT</a>, <a href="https://en.wikipedia.org/wiki/Office_Open_XML">Word docx</a>, <a href="http://www.gnu.org/software/texinfo/">GNU Texinfo</a>, <a href="https://www.mediawiki.org/wiki/Help:Formatting">MediaWiki markup</a>, <a href="https://www.dokuwiki.org/dokuwiki">DokuWiki markup</a>, <a href="http://zim-wiki.org/manual/Help/Wiki_Syntax.html">ZimWiki markup</a>, <a href="https://www.haskell.org/haddock/doc/html/ch03s08.html">Haddock markup</a>, <a href="http://idpf.org/epub">EPUB</a> (v2 or v3), <a href="http://www.fictionbook.org/index.php/Eng:XML_Schema_Fictionbook_2.1">FictionBook2</a>, <a href="http://redcloth.org/textile">Textile</a>, <a href="http://man7.org/linux/man-pages/man7/groff_man.7.html">groff man</a> pages, <a href="http://orgmode.org">Emacs Org mode</a>, <a href="http://www.methods.co.nz/asciidoc/">AsciiDoc</a>, <a href="https://www.adobe.com/content/dam/Adobe/en/devnet/indesign/cs55-docs/IDML/idml-specification.pdf">InDesign ICML</a>, <a href="https://github.com/TEIC/TEI-Simple">TEI Simple</a>, and <a href="http://www.w3.org/Talks/Tools/Slidy/">Slidy</a>, <a href="http://goessner.net/articles/slideous/">Slideous</a>, <a href="http://paulrouget.com/dzslides/">DZSlides</a>, <a href="http://lab.hakim.se/reveal-js/">reveal.js</a> or <a href="http://meyerweb.com/eric/tools/s5/">S5</a> HTML slide shows. It can also produce <a href="https://www.adobe.com/pdf/">PDF</a> output on systems where LaTeX, ConTeXt, or <code>wkhtmltopdf</code> is installed.</p>
<p>Pandoc’s enhanced version of Markdown includes syntax for <a href="#footnotes">footnotes</a>, <a href="#tables">tables</a>, flexible <a href="#ordered-lists">ordered lists</a>, <a href="#definition-lists">definition lists</a>, <a href="#fenced-code-blocks">fenced code blocks</a>, <a href="#superscripts-and-subscripts">superscripts and subscripts</a>, <a href="#strikeout">strikeout</a>, <a href="#metadata-blocks">metadata blocks</a>, automatic tables of contents, embedded LaTeX <a href="#math">math</a>, <a href="#citations">citations</a>, and <a href="#extension-markdown_in_html_blocks">Markdown inside HTML block elements</a>. (These enhancements, described further under <a href="#pandocs-markdown">Pandoc’s Markdown</a>, can be disabled using the <code>markdown_strict</code> input or output format.)</p>
<p>In contrast to most existing tools for converting Markdown to HTML, which use regex substitutions, pandoc has a modular design: it consists of a set of readers, which parse text in a given format and produce a native representation of the document, and a set of writers, which convert this native representation into a target format. Thus, adding an input or output format requires only adding a reader or writer.</p>
<p>Because pandoc’s intermediate representation of a document is less expressive than many of the formats it converts between, one should not expect perfect conversions between every format and every other. Pandoc attempts to preserve the structural elements of a document, but not formatting details such as margin size. And some document elements, such as complex tables, may not fit into pandoc’s simple document model. While conversions from pandoc’s Markdown to all formats aspire to be perfect, conversions from formats more expressive than pandoc’s Markdown can be expected to be lossy.</p>
<h2 id="using-pandoc">Using <code>pandoc</code></h2>
<p>If no <em>input-file</em> is specified, input is read from <em>stdin</em>. Otherwise, the <em>input-files</em> are concatenated (with a blank line between each) and used as input. Output goes to <em>stdout</em> by default (though output to <em>stdout</em> is disabled for the <code>odt</code>, <code>docx</code>, <code>epub</code>, and <code>epub3</code> output formats). For output to a file, use the <code>-o</code> option:</p>
<pre><code>pandoc -o output.html input.txt</code></pre>
<p>By default, pandoc produces a document fragment, not a standalone document with a proper header and footer. To produce a standalone document, use the <code>-s</code> or <code>--standalone</code> flag:</p>
<pre><code>pandoc -s -o output.html input.txt</code></pre>
<p>For more information on how standalone documents are produced, see <a href="#templates">Templates</a>, below.</p>
<p>Instead of a file, an absolute URI may be given. In this case pandoc will fetch the content using HTTP:</p>
<pre><code>pandoc -f html -t markdown http://www.fsf.org</code></pre>
<p>If multiple input files are given, <code>pandoc</code> will concatenate them all (with blank lines between them) before parsing. This feature is disabled for binary input formats such as <code>EPUB</code>, <code>odt</code>, and <code>docx</code>.</p>
<p>The format of the input and output can be specified explicitly using command-line options. The input format can be specified using the <code>-r/--read</code> or <code>-f/--from</code> options, the output format using the <code>-w/--write</code> or <code>-t/--to</code> options. Thus, to convert <code>hello.txt</code> from Markdown to LaTeX, you could type:</p>
<pre><code>pandoc -f markdown -t latex hello.txt</code></pre>
<p>To convert <code>hello.html</code> from HTML to Markdown:</p>
<pre><code>pandoc -f html -t markdown hello.html</code></pre>
<p>Supported output formats are listed below under the <code>-t/--to</code> option. Supported input formats are listed below under the <code>-f/--from</code> option. Note that the <code>rst</code>, <code>textile</code>, <code>latex</code>, and <code>html</code> readers are not complete; there are some constructs that they do not parse.</p>
<p>If the input or output format is not specified explicitly, <code>pandoc</code> will attempt to guess it from the extensions of the input and output filenames. Thus, for example,</p>
<pre><code>pandoc -o hello.tex hello.txt</code></pre>
<p>will convert <code>hello.txt</code> from Markdown to LaTeX. If no output file is specified (so that output goes to <em>stdout</em>), or if the output file’s extension is unknown, the output format will default to HTML. If no input file is specified (so that input comes from <em>stdin</em>), or if the input files’ extensions are unknown, the input format will be assumed to be Markdown unless explicitly specified.</p>
<p>Pandoc uses the UTF-8 character encoding for both input and output. If your local character encoding is not UTF-8, you should pipe input and output through <a href="http://www.gnu.org/software/libiconv/"><code>iconv</code></a>:</p>
<pre><code>iconv -t utf-8 input.txt | pandoc | iconv -f utf-8</code></pre>
<p>Note that in some output formats (such as HTML, LaTeX, ConTeXt, RTF, OPML, DocBook, and Texinfo), information about the character encoding is included in the document header, which will only be included if you use the <code>-s/--standalone</code> option.</p>
<h2 id="creating-a-pdf">Creating a PDF</h2>
<p>To produce a PDF, specify an output file with a <code>.pdf</code> extension. By default, pandoc will use LaTeX to convert it to PDF:</p>
<pre><code>pandoc test.txt -o test.pdf</code></pre>
<p>Production of a PDF requires that a LaTeX engine be installed (see <code>--latex-engine</code>, below), and assumes that the following LaTeX packages are available: <a href="https://ctan.org/pkg/amsfonts"><code>amsfonts</code></a>, <a href="https://ctan.org/pkg/amsmath"><code>amsmath</code></a>, <a href="https://ctan.org/pkg/lm"><code>lm</code></a>, <a href="https://ctan.org/pkg/ifxetex"><code>ifxetex</code></a>, <a href="https://ctan.org/pkg/ifluatex"><code>ifluatex</code></a>, <a href="https://ctan.org/pkg/eurosym"><code>eurosym</code></a>, <a href="https://ctan.org/pkg/listings"><code>listings</code></a> (if the <code>--listings</code> option is used), <a href="https://ctan.org/pkg/fancyvrb"><code>fancyvrb</code></a>, <a href="https://ctan.org/pkg/longtable"><code>longtable</code></a>, <a href="https://ctan.org/pkg/booktabs"><code>booktabs</code></a>, <a href="https://ctan.org/pkg/graphicx"><code>graphicx</code></a> and <a href="https://ctan.org/pkg/grffile"><code>grffile</code></a> (if the document contains images), <a href="https://ctan.org/pkg/hyperref"><code>hyperref</code></a>, <a href="https://ctan.org/pkg/ulem"><code>ulem</code></a>, <a href="https://ctan.org/pkg/geometry"><code>geometry</code></a> (with the <code>geometry</code> variable set), <a href="https://ctan.org/pkg/setspace"><code>setspace</code></a> (with <code>linestretch</code>), and <a href="https://ctan.org/pkg/babel"><code>babel</code></a> (with <code>lang</code>). The use of <code>xelatex</code> or <code>lualatex</code> as the LaTeX engine requires <a href="https://ctan.org/pkg/fontspec"><code>fontspec</code></a>; <code>xelatex</code> uses <a href="https://ctan.org/pkg/mathspec"><code>mathspec</code></a>, <a href="https://ctan.org/pkg/polyglossia"><code>polyglossia</code></a> (with <code>lang</code>), <a href="https://ctan.org/pkg/xecjk"><code>xecjk</code></a>, and <a href="https://ctan.org/pkg/bidi"><code>bidi</code></a> (with the <code>dir</code> variable set). The <a href="https://ctan.org/pkg/upquote"><code>upquote</code></a> and <a href="https://ctan.org/pkg/microtype"><code>microtype</code></a> packages are used if available, and <a href="https://ctan.org/pkg/csquotes"><code>csquotes</code></a> will be used for <a href="#smart-punctuation">smart punctuation</a> if added to the template or included in any header file. The <a href="https://ctan.org/pkg/natbib"><code>natbib</code></a>, <a href="https://ctan.org/pkg/biblatex"><code>biblatex</code></a>, <a href="https://ctan.org/pkg/bibtex"><code>bibtex</code></a>, and <a href="https://ctan.org/pkg/biber"><code>biber</code></a> packages can optionally be used for <a href="#citation-rendering">citation rendering</a>. These are included with all recent versions of <a href="http://www.tug.org/texlive/">TeX Live</a>.</p>
<p>Alternatively, pandoc can use ConTeXt or <code>wkhtmltopdf</code> to create a PDF. To do this, specify an output file with a <code>.pdf</code> extension, as before, but add <code>-t context</code> or <code>-t html5</code> to the command line.</p>
<p>PDF output can be controlled using <a href="#variables-for-latex">variables for LaTeX</a> (if LaTeX is used) and <a href="#variables-for-context">variables for ConTeXt</a> (if ConTeXt is used). If <code>wkhtmltopdf</code> is used, then the variables <code>margin-left</code>, <code>margin-right</code>, <code>margin-top</code>, <code>margin-bottom</code>, and <code>papersize</code> will affect the output, as will <code>--css</code>.</p>
<h1 id="options">Options</h1>
<h2 id="general-options">General options</h2>
<dl>
<dt><code>-f</code> <em>FORMAT</em>, <code>-r</code> <em>FORMAT</em>, <code>--from=</code><em>FORMAT</em>, <code>--read=</code><em>FORMAT</em></dt>
<dd><p>Specify input format. <em>FORMAT</em> can be <code>native</code> (native Haskell), <code>json</code> (JSON version of native AST), <code>markdown</code> (pandoc’s extended Markdown), <code>markdown_strict</code> (original unextended Markdown), <code>markdown_phpextra</code> (PHP Markdown Extra), <code>markdown_github</code> (GitHub-Flavored Markdown), <code>markdown_mmd</code> (MultiMarkdown), <code>commonmark</code> (CommonMark Markdown), <code>textile</code> (Textile), <code>rst</code> (reStructuredText), <code>html</code> (HTML), <code>docbook</code> (DocBook), <code>t2t</code> (txt2tags), <code>docx</code> (docx), <code>odt</code> (ODT), <code>epub</code> (EPUB), <code>opml</code> (OPML), <code>org</code> (Emacs Org mode), <code>mediawiki</code> (MediaWiki markup), <code>twiki</code> (TWiki markup), <code>haddock</code> (Haddock markup), or <code>latex</code> (LaTeX). If <code>+lhs</code> is appended to <code>markdown</code>, <code>rst</code>, <code>latex</code>, or <code>html</code>, the input will be treated as literate Haskell source: see <a href="#literate-haskell-support">Literate Haskell support</a>, below. Markdown syntax extensions can be individually enabled or disabled by appending <code>+EXTENSION</code> or <code>-EXTENSION</code> to the format name. So, for example, <code>markdown_strict+footnotes+definition_lists</code> is strict Markdown with footnotes and definition lists enabled, and <code>markdown-pipe_tables+hard_line_breaks</code> is pandoc’s Markdown without pipe tables and with hard line breaks. See <a href="#pandocs-markdown">Pandoc’s Markdown</a>, below, for a list of extensions and their names. See <code>--list-input-formats</code> and <code>--list-extensions</code>, below.</p>
</dd>
<dt><code>-t</code> <em>FORMAT</em>, <code>-w</code> <em>FORMAT</em>, <code>--to=</code><em>FORMAT</em>, <code>--write=</code><em>FORMAT</em></dt>
<dd><p>Specify output format. <em>FORMAT</em> can be <code>native</code> (native Haskell), <code>json</code> (JSON version of native AST), <code>plain</code> (plain text), <code>markdown</code> (pandoc’s extended Markdown), <code>markdown_strict</code> (original unextended Markdown), <code>markdown_phpextra</code> (PHP Markdown Extra), <code>markdown_github</code> (GitHub-Flavored Markdown), <code>markdown_mmd</code> (MultiMarkdown), <code>commonmark</code> (CommonMark Markdown), <code>rst</code> (reStructuredText), <code>html</code> (XHTML), <code>html5</code> (HTML5), <code>latex</code> (LaTeX), <code>beamer</code> (LaTeX beamer slide show), <code>context</code> (ConTeXt), <code>man</code> (groff man), <code>mediawiki</code> (MediaWiki markup), <code>dokuwiki</code> (DokuWiki markup), <code>zimwiki</code> (ZimWiki markup), <code>textile</code> (Textile), <code>org</code> (Emacs Org mode), <code>texinfo</code> (GNU Texinfo), <code>opml</code> (OPML), <code>docbook</code> (DocBook 4), <code>docbook5</code> (DocBook 5), <code>opendocument</code> (OpenDocument), <code>odt</code> (OpenOffice text document), <code>docx</code> (Word docx), <code>haddock</code> (Haddock markup), <code>rtf</code> (rich text format), <code>epub</code> (EPUB v2 book), <code>epub3</code> (EPUB v3), <code>fb2</code> (FictionBook2 e-book), <code>asciidoc</code> (AsciiDoc), <code>icml</code> (InDesign ICML), <code>tei</code> (TEI Simple), <code>slidy</code> (Slidy HTML and JavaScript slide show), <code>slideous</code> (Slideous HTML and JavaScript slide show), <code>dzslides</code> (DZSlides HTML5 + JavaScript slide show), <code>revealjs</code> (reveal.js HTML5 + JavaScript slide show), <code>s5</code> (S5 HTML and JavaScript slide show), or the path of a custom lua writer (see <a href="#custom-writers">Custom writers</a>, below). Note that <code>odt</code>, <code>epub</code>, and <code>epub3</code> output will not be directed to <em>stdout</em>; an output filename must be specified using the <code>-o/--output</code> option. If <code>+lhs</code> is appended to <code>markdown</code>, <code>rst</code>, <code>latex</code>, <code>beamer</code>, <code>html</code>, or <code>html5</code>, the output will be rendered as literate Haskell source: see <a href="#literate-haskell-support">Literate Haskell support</a>, below. Markdown syntax extensions can be individually enabled or disabled by appending <code>+EXTENSION</code> or <code>-EXTENSION</code> to the format name, as described above under <code>-f</code>. See <code>--list-output-formats</code> and <code>--list-extensions</code>, below.</p>
</dd>
<dt><code>-o</code> <em>FILE</em>, <code>--output=</code><em>FILE</em></dt>
<dd><p>Write output to <em>FILE</em> instead of <em>stdout</em>. If <em>FILE</em> is <code>-</code>, output will go to <em>stdout</em>. (Exception: if the output format is <code>odt</code>, <code>docx</code>, <code>epub</code>, or <code>epub3</code>, output to stdout is disabled.)</p>
</dd>
<dt><code>--data-dir=</code><em>DIRECTORY</em></dt>
<dd><p>Specify the user data directory to search for pandoc data files. If this option is not specified, the default user data directory will be used. This is, in Unix:</p>
<pre><code>$HOME/.pandoc</code></pre>
<p>in Windows XP:</p>
<pre><code>C:\Documents And Settings\USERNAME\Application Data\pandoc</code></pre>
<p>and in Windows Vista or later:</p>
<pre><code>C:\Users\USERNAME\AppData\Roaming\pandoc</code></pre>
<p>You can find the default user data directory on your system by looking at the output of <code>pandoc --version</code>. A <code>reference.odt</code>, <code>reference.docx</code>, <code>epub.css</code>, <code>templates</code>, <code>slidy</code>, <code>slideous</code>, or <code>s5</code> directory placed in this directory will override pandoc’s normal defaults.</p>
</dd>
<dt><code>--bash-completion</code></dt>
<dd><p>Generate a bash completion script. To enable bash completion with pandoc, add this to your <code>.bashrc</code>:</p>
<pre><code> eval &quot;$(pandoc --bash-completion)&quot;</code></pre>
</dd>
<dt><code>--verbose</code></dt>
<dd><p>Give verbose debugging output. Currently this only has an effect with PDF output.</p>
</dd>
<dt><code>--list-input-formats</code></dt>
<dd><p>List supported input formats, one per line.</p>
</dd>
<dt><code>--list-output-formats</code></dt>
<dd><p>List supported output formats, one per line.</p>
</dd>
<dt><code>--list-extensions</code></dt>
<dd><p>List supported Markdown extensions, one per line, followed by a <code>+</code> or <code>-</code> indicating whether it is enabled by default in pandoc’s Markdown.</p>
</dd>
<dt><code>--list-highlight-languages</code></dt>
<dd><p>List supported languages for syntax highlighting, one per line.</p>
</dd>
<dt><code>--list-highlight-styles</code></dt>
<dd><p>List supported styles for syntax highlighting, one per line. See <code>--highlight-style</code>.</p>
</dd>
<dt><code>-v</code>, <code>--version</code></dt>
<dd><p>Print version.</p>
</dd>
<dt><code>-h</code>, <code>--help</code></dt>
<dd><p>Show usage message.</p>
</dd>
</dl>
<h2 id="reader-options">Reader options</h2>
<dl>
<dt><code>-R</code>, <code>--parse-raw</code></dt>
<dd><p>Parse untranslatable HTML codes and LaTeX environments as raw HTML or LaTeX, instead of ignoring them. Affects only HTML and LaTeX input. Raw HTML can be printed in Markdown, reStructuredText, Emacs Org mode, HTML, Slidy, Slideous, DZSlides, reveal.js, and S5 output; raw LaTeX can be printed in Markdown, reStructuredText, Emacs Org mode, LaTeX, and ConTeXt output. The default is for the readers to omit untranslatable HTML codes and LaTeX environments. (The LaTeX reader does pass through untranslatable LaTeX <em>commands</em>, even if <code>-R</code> is not specified.)</p>
</dd>
<dt><code>-S</code>, <code>--smart</code></dt>
<dd><p>Produce typographically correct output, converting straight quotes to curly quotes, <code>---</code> to em-dashes, <code>--</code> to en-dashes, and <code>...</code> to ellipses. Nonbreaking spaces are inserted after certain abbreviations, such as “Mr.” (Note: This option is selected automatically when the output format is <code>latex</code> or <code>context</code>, unless <code>--no-tex-ligatures</code> is used. It has no effect for <code>latex</code> input.)</p>
</dd>
<dt><code>--old-dashes</code></dt>
<dd><p>Selects the pandoc &lt;= 1.8.2.1 behavior for parsing smart dashes: <code>-</code> before a numeral is an en-dash, and <code>--</code> is an em-dash. This option is selected automatically for <code>textile</code> input.</p>
</dd>
<dt><code>--base-header-level=</code><em>NUMBER</em></dt>
<dd><p>Specify the base level for headers (defaults to 1).</p>
</dd>
<dt><code>--indented-code-classes=</code><em>CLASSES</em></dt>
<dd><p>Specify classes to use for indented code blocks–for example, <code>perl,numberLines</code> or <code>haskell</code>. Multiple classes may be separated by spaces or commas.</p>
</dd>
<dt><code>--default-image-extension=</code><em>EXTENSION</em></dt>
<dd><p>Specify a default extension to use when image paths/URLs have no extension. This allows you to use the same source for formats that require different kinds of images. Currently this option only affects the Markdown and LaTeX readers.</p>
</dd>
<dt><code>--file-scope</code></dt>
<dd><p>Parse each file individually before combining for multifile documents. This will allow footnotes in different files with the same identifiers to work as expected. If this option is set, footnotes and links will not work across files. Reading binary files (docx, odt, epub) implies <code>--file-scope</code>.</p>
</dd>
<dt><code>--filter=</code><em>PROGRAM</em></dt>
<dd><p>Specify an executable to be used as a filter transforming the pandoc AST after the input is parsed and before the output is written. The executable should read JSON from stdin and write JSON to stdout. The JSON must be formatted like pandoc’s own JSON input and output. The name of the output format will be passed to the filter as the first argument. Hence,</p>
<pre><code>pandoc --filter ./caps.py -t latex</code></pre>
<p>is equivalent to</p>
<pre><code>pandoc -t json | ./caps.py latex | pandoc -f json -t latex</code></pre>
<p>The latter form may be useful for debugging filters.</p>
<p>Filters may be written in any language. <code>Text.Pandoc.JSON</code> exports <code>toJSONFilter</code> to facilitate writing filters in Haskell. Those who would prefer to write filters in python can use the module <a href="https://github.com/jgm/pandocfilters"><code>pandocfilters</code></a>, installable from PyPI. There are also pandoc filter libraries in <a href="https://github.com/vinai/pandocfilters-php">PHP</a>, <a href="https://metacpan.org/pod/Pandoc::Filter">perl</a>, and <a href="https://github.com/mvhenderson/pandoc-filter-node">javascript/node.js</a>.</p>
<p>In order of preference, pandoc will look for filters in</p>
<ol style="list-style-type: decimal">
<li><p>a specified full or relative path (executable or non-executable)</p></li>
<li><p><code>$DATADIR/filters</code> (executable or non-executable)</p></li>
<li><p><code>$PATH</code> (executable only)</p></li>
</ol>
</dd>
<dt><code>-M</code> <em>KEY</em>[<code>=</code><em>VAL</em>], <code>--metadata=</code><em>KEY</em>[<code>:</code><em>VAL</em>]</dt>
<dd><p>Set the metadata field <em>KEY</em> to the value <em>VAL</em>. A value specified on the command line overrides a value specified in the document. Values will be parsed as YAML boolean or string values. If no value is specified, the value will be treated as Boolean true. Like <code>--variable</code>, <code>--metadata</code> causes template variables to be set. But unlike <code>--variable</code>, <code>--metadata</code> affects the metadata of the underlying document (which is accessible from filters and may be printed in some output formats).</p>
</dd>
<dt><code>--normalize</code></dt>
<dd><p>Normalize the document after reading: merge adjacent <code>Str</code> or <code>Emph</code> elements, for example, and remove repeated <code>Space</code>s.</p>
</dd>
<dt><code>-p</code>, <code>--preserve-tabs</code></dt>
<dd><p>Preserve tabs instead of converting them to spaces (the default). Note that this will only affect tabs in literal code spans and code blocks; tabs in regular text will be treated as spaces.</p>
</dd>
<dt><code>--tab-stop=</code><em>NUMBER</em></dt>
<dd><p>Specify the number of spaces per tab (default is 4).</p>
</dd>
<dt><code>--track-changes=accept</code>|<code>reject</code>|<code>all</code></dt>
<dd><p>Specifies what to do with insertions, deletions, and comments produced by the MS Word “Track Changes” feature. <code>accept</code> (the default), inserts all insertions, and ignores all deletions. <code>reject</code> inserts all deletions and ignores insertions. Both <code>accept</code> and <code>reject</code> ignore comments. <code>all</code> puts in insertions, deletions, and comments, wrapped in spans with <code>insertion</code>, <code>deletion</code>, <code>comment-start</code>, and <code>comment-end</code> classes, respectively. The author and time of change is included. <code>all</code> is useful for scripting: only accepting changes from a certain reviewer, say, or before a certain date. This option only affects the docx reader.</p>
</dd>
<dt><code>--extract-media=</code><em>DIR</em></dt>
<dd><p>Extract images and other media contained in a docx or epub container to the path <em>DIR</em>, creating it if necessary, and adjust the images references in the document so they point to the extracted files. This option only affects the docx and epub readers.</p>
</dd>
</dl>
<h2 id="general-writer-options">General writer options</h2>
<dl>
<dt><code>-s</code>, <code>--standalone</code></dt>
<dd><p>Produce output with an appropriate header and footer (e.g. a standalone HTML, LaTeX, TEI, or RTF file, not a fragment). This option is set automatically for <code>pdf</code>, <code>epub</code>, <code>epub3</code>, <code>fb2</code>, <code>docx</code>, and <code>odt</code> output.</p>
</dd>
<dt><code>--template=</code><em>FILE</em></dt>
<dd><p>Use <em>FILE</em> as a custom template for the generated document. Implies <code>--standalone</code>. See <a href="#templates">Templates</a>, below, for a description of template syntax. If no extension is specified, an extension corresponding to the writer will be added, so that <code>--template=special</code> looks for <code>special.html</code> for HTML output. If the template is not found, pandoc will search for it in the <code>templates</code> subdirectory of the user data directory (see <code>--data-dir</code>). If this option is not used, a default template appropriate for the output format will be used (see <code>-D/--print-default-template</code>).</p>
</dd>
<dt><code>-V</code> <em>KEY</em>[<code>=</code><em>VAL</em>], <code>--variable=</code><em>KEY</em>[<code>:</code><em>VAL</em>]</dt>
<dd><p>Set the template variable <em>KEY</em> to the value <em>VAL</em> when rendering the document in standalone mode. This is generally only useful when the <code>--template</code> option is used to specify a custom template, since pandoc automatically sets the variables used in the default templates. If no <em>VAL</em> is specified, the key will be given the value <code>true</code>.</p>
</dd>
<dt><code>-D</code> <em>FORMAT</em>, <code>--print-default-template=</code><em>FORMAT</em></dt>
<dd><p>Print the system default template for an output <em>FORMAT</em>. (See <code>-t</code> for a list of possible <em>FORMAT</em>s.) Templates in the user data directory are ignored.</p>
</dd>
<dt><code>--print-default-data-file=</code><em>FILE</em></dt>
<dd><p>Print a system default data file. Files in the user data directory are ignored.</p>
</dd>
<dt><code>--dpi</code>=<em>NUMBER</em></dt>
<dd>Specify the dpi (dots per inch) value for conversion from pixels to inch/centimeters and vice versa. The default is 96dpi. Technically, the correct term would be ppi (pixels per inch).
</dd>
<dt><code>--wrap=auto</code>|<code>none</code>|<code>preserve</code></dt>
<dd><p>Determine how text is wrapped in the output (the source code, not the rendered version). With <code>auto</code> (the default), pandoc will attempt to wrap lines to the column width specified by <code>--columns</code> (default 72). With <code>none</code>, pandoc will not wrap lines at all. With <code>preserve</code>, pandoc will attempt to preserve the wrapping from the source document (that is, where there are nonsemantic newlines in the source, there will be nonsemantic newlines in the output as well). Automatic wrapping does not currently work in HTML output.</p>
</dd>
<dt><code>--no-wrap</code></dt>
<dd><p>Deprecated synonym for <code>--wrap=none</code>.</p>
</dd>
<dt><code>--columns=</code><em>NUMBER</em></dt>
<dd><p>Specify length of lines in characters. This affects text wrapping in the generated source code (see <code>--wrap</code>). It also affects calculation of column widths for plain text tables (see <a href="#tables">Tables</a> below).</p>
</dd>
<dt><code>--toc</code>, <code>--table-of-contents</code></dt>
<dd><p>Include an automatically generated table of contents (or, in the case of <code>latex</code>, <code>context</code>, <code>docx</code>, and <code>rst</code>, an instruction to create one) in the output document. This option has no effect on <code>man</code>, <code>docbook</code>, <code>docbook5</code>, <code>slidy</code>, <code>slideous</code>, <code>s5</code>, or <code>odt</code> output.</p>
</dd>
<dt><code>--toc-depth=</code><em>NUMBER</em></dt>
<dd><p>Specify the number of section levels to include in the table of contents. The default is 3 (which means that level 1, 2, and 3 headers will be listed in the contents).</p>
</dd>
<dt><code>--no-highlight</code></dt>
<dd><p>Disables syntax highlighting for code blocks and inlines, even when a language attribute is given.</p>
</dd>
<dt><code>--highlight-style=</code><em>STYLE</em></dt>
<dd><p>Specifies the coloring style to be used in highlighted source code. Options are <code>pygments</code> (the default), <code>kate</code>, <code>monochrome</code>, <code>breezeDark</code>, <code>espresso</code>, <code>zenburn</code>, <code>haddock</code>, and <code>tango</code>. For more information on syntax highlighting in pandoc, see <a href="#syntax-highlighting">Syntax highlighting</a>, below. See also <code>--list-highlight-styles</code>.</p>
</dd>
<dt><code>-H</code> <em>FILE</em>, <code>--include-in-header=</code><em>FILE</em></dt>
<dd><p>Include contents of <em>FILE</em>, verbatim, at the end of the header. This can be used, for example, to include special CSS or JavaScript in HTML documents. This option can be used repeatedly to include multiple files in the header. They will be included in the order specified. Implies <code>--standalone</code>.</p>
</dd>
<dt><code>-B</code> <em>FILE</em>, <code>--include-before-body=</code><em>FILE</em></dt>
<dd><p>Include contents of <em>FILE</em>, verbatim, at the beginning of the document body (e.g. after the <code>&lt;body&gt;</code> tag in HTML, or the <code>\begin{document}</code> command in LaTeX). This can be used to include navigation bars or banners in HTML documents. This option can be used repeatedly to include multiple files. They will be included in the order specified. Implies <code>--standalone</code>.</p>
</dd>
<dt><code>-A</code> <em>FILE</em>, <code>--include-after-body=</code><em>FILE</em></dt>
<dd><p>Include contents of <em>FILE</em>, verbatim, at the end of the document body (before the <code>&lt;/body&gt;</code> tag in HTML, or the <code>\end{document}</code> command in LaTeX). This option can be used repeatedly to include multiple files. They will be included in the order specified. Implies <code>--standalone</code>.</p>
</dd>
</dl>
<h2 id="options-affecting-specific-writers">Options affecting specific writers</h2>
<dl>
<dt><code>--self-contained</code></dt>
<dd><p>Produce a standalone HTML file with no external dependencies, using <code>data:</code> URIs to incorporate the contents of linked scripts, stylesheets, images, and videos. The resulting file should be “self-contained,” in the sense that it needs no external files and no net access to be displayed properly by a browser. This option works only with HTML output formats, including <code>html</code>, <code>html5</code>, <code>html+lhs</code>, <code>html5+lhs</code>, <code>s5</code>, <code>slidy</code>, <code>slideous</code>, <code>dzslides</code>, and <code>revealjs</code>. Scripts, images, and stylesheets at absolute URLs will be downloaded; those at relative URLs will be sought relative to the working directory (if the first source file is local) or relative to the base URL (if the first source file is remote). Limitation: resources that are loaded dynamically through JavaScript cannot be incorporated; as a result, <code>--self-contained</code> does not work with <code>--mathjax</code>, and some advanced features (e.g. zoom or speaker notes) may not work in an offline “self-contained” <code>reveal.js</code> slide show.</p>
</dd>
<dt><code>--html-q-tags</code></dt>
<dd><p>Use <code>&lt;q&gt;</code> tags for quotes in HTML.</p>
</dd>
<dt><code>--ascii</code></dt>
<dd><p>Use only ASCII characters in output. Currently supported only for HTML output (which uses numerical entities instead of UTF-8 when this option is selected).</p>
</dd>
<dt><code>--reference-links</code></dt>
<dd><p>Use reference-style links, rather than inline links, in writing Markdown or reStructuredText. By default inline links are used. The placement of link references is affected by the <code>--reference-location</code> option.</p>
</dd>
<dt><code>--reference-location = block</code>|<code>section</code>|<code>document</code></dt>
<dd><p>Specify whether footnotes (and references, if <code>reference-links</code> is set) are placed at the end of the current (top-level) block, the current section, or the document. The default is <code>document</code>. Currently only affects the markdown writer.</p>
</dd>
<dt><code>--atx-headers</code></dt>
<dd><p>Use ATX-style headers in Markdown and AsciiDoc output. The default is to use setext-style headers for levels 1-2, and then ATX headers.</p>
</dd>
<dt><code>--chapters</code></dt>
<dd><p>Deprecated synonym for <code>--top-level-division=chapter</code>.</p>
</dd>
<dt><code>--top-level-division=[default|section|chapter|part]</code></dt>
<dd><p>Treat top-level headers as the given division type in LaTeX, ConTeXt, DocBook, and TEI output. The hierarchy order is part, chapter, then section; all headers are shifted such that the top-level header becomes the specified type. The default behavior is to determine the best division type via heuristics: unless other conditions apply, <code>section</code> is chosen. When the LaTeX document class is set to <code>report</code>, <code>book</code>, or <code>memoir</code> (unless the <code>article</code> option is specified), <code>chapter</code> is implied as the setting for this option. If <code>beamer</code> is the output format, specifying either <code>chapter</code> or <code>part</code> will cause top-level headers to become <code>\part{..}</code>, while second-level headers remain as their default type.</p>
</dd>
<dt><code>-N</code>, <code>--number-sections</code></dt>
<dd><p>Number section headings in LaTeX, ConTeXt, HTML, or EPUB output. By default, sections are not numbered. Sections with class <code>unnumbered</code> will never be numbered, even if <code>--number-sections</code> is specified.</p>
</dd>
<dt><code>--number-offset=</code><em>NUMBER</em>[<code>,</code><em>NUMBER</em><code>,</code><em>…</em>]</dt>
<dd><p>Offset for section headings in HTML output (ignored in other output formats). The first number is added to the section number for top-level headers, the second for second-level headers, and so on. So, for example, if you want the first top-level header in your document to be numbered “6”, specify <code>--number-offset=5</code>. If your document starts with a level-2 header which you want to be numbered “1.5”, specify <code>--number-offset=1,4</code>. Offsets are 0 by default. Implies <code>--number-sections</code>.</p>
</dd>
<dt><code>--no-tex-ligatures</code></dt>
<dd><p>Do not use the TeX ligatures for quotation marks, apostrophes, and dashes (<code>`...'</code>, <code>``..''</code>, <code>--</code>, <code>---</code>) when writing or reading LaTeX or ConTeXt. In reading LaTeX, parse the characters <code>`</code>, <code>'</code>, and <code>-</code> literally, rather than parsing ligatures for quotation marks and dashes. In writing LaTeX or ConTeXt, print unicode quotation mark and dash characters literally, rather than converting them to the standard ASCII TeX ligatures. Note: normally <code>--smart</code> is selected automatically for LaTeX and ConTeXt output, but it must be specified explicitly if <code>--no-tex-ligatures</code> is selected. If you use literal curly quotes, dashes, and ellipses in your source, then you may want to use <code>--no-tex-ligatures</code> without <code>--smart</code>.</p>
</dd>
<dt><code>--listings</code></dt>
<dd><p>Use the <a href="https://ctan.org/pkg/listings"><code>listings</code></a> package for LaTeX code blocks</p>
</dd>
<dt><code>-i</code>, <code>--incremental</code></dt>
<dd><p>Make list items in slide shows display incrementally (one by one). The default is for lists to be displayed all at once.</p>
</dd>
<dt><code>--slide-level=</code><em>NUMBER</em></dt>
<dd><p>Specifies that headers with the specified level create slides (for <code>beamer</code>, <code>s5</code>, <code>slidy</code>, <code>slideous</code>, <code>dzslides</code>). Headers above this level in the hierarchy are used to divide the slide show into sections; headers below this level create subheads within a slide. The default is to set the slide level based on the contents of the document; see <a href="#structuring-the-slide-show">Structuring the slide show</a>.</p>
</dd>
<dt><code>--section-divs</code></dt>
<dd><p>Wrap sections in <code>&lt;div&gt;</code> tags (or <code>&lt;section&gt;</code> tags in HTML5), and attach identifiers to the enclosing <code>&lt;div&gt;</code> (or <code>&lt;section&gt;</code>) rather than the header itself. See <a href="#header-identifiers">Header identifiers</a>, below.</p>
</dd>
<dt><code>--email-obfuscation=none</code>|<code>javascript</code>|<code>references</code></dt>
<dd><p>Specify a method for obfuscating <code>mailto:</code> links in HTML documents. <code>none</code> leaves <code>mailto:</code> links as they are. <code>javascript</code> obfuscates them using JavaScript. <code>references</code> obfuscates them by printing their letters as decimal or hexadecimal character references. The default is <code>none</code>.</p>
</dd>
<dt><code>--id-prefix=</code><em>STRING</em></dt>
<dd><p>Specify a prefix to be added to all automatically generated identifiers in HTML and DocBook output, and to footnote numbers in Markdown output. This is useful for preventing duplicate identifiers when generating fragments to be included in other pages.</p>
</dd>
<dt><code>-T</code> <em>STRING</em>, <code>--title-prefix=</code><em>STRING</em></dt>
<dd><p>Specify <em>STRING</em> as a prefix at the beginning of the title that appears in the HTML header (but not in the title as it appears at the beginning of the HTML body). Implies <code>--standalone</code>.</p>
</dd>
<dt><code>-c</code> <em>URL</em>, <code>--css=</code><em>URL</em></dt>
<dd><p>Link to a CSS style sheet. This option can be used repeatedly to include multiple files. They will be included in the order specified.</p>
</dd>
<dt><code>--reference-odt=</code><em>FILE</em></dt>
<dd><p>Use the specified file as a style reference in producing an ODT. For best results, the reference ODT should be a modified version of an ODT produced using pandoc. The contents of the reference ODT are ignored, but its stylesheets are used in the new ODT. If no reference ODT is specified on the command line, pandoc will look for a file <code>reference.odt</code> in the user data directory (see <code>--data-dir</code>). If this is not found either, sensible defaults will be used.</p>
<p>To produce a custom <code>reference.odt</code>, first get a copy of the default <code>reference.odt</code>: <code>pandoc --print-default-data-file reference.odt &gt; custom-reference.odt</code>. Then open <code>custom-reference.docx</code> in LibreOffice, modify the styles as you wish, and save the file.</p>
</dd>
<dt><code>--reference-docx=</code><em>FILE</em></dt>
<dd><p>Use the specified file as a style reference in producing a docx file. For best results, the reference docx should be a modified version of a docx file produced using pandoc. The contents of the reference docx are ignored, but its stylesheets and document properties (including margins, page size, header, and footer) are used in the new docx. If no reference docx is specified on the command line, pandoc will look for a file <code>reference.docx</code> in the user data directory (see <code>--data-dir</code>). If this is not found either, sensible defaults will be used.</p>
<p>To produce a custom <code>reference.docx</code>, first get a copy of the default <code>reference.docx</code>: <code>pandoc --print-default-data-file reference.docx &gt; custom-reference.docx</code>. Then open <code>custom-reference.docx</code> in Word, modify the styles as you wish, and save the file. For best results, do not make changes to this file other than modifying the styles used by pandoc: [paragraph] Normal, Body Text, First Paragraph, Compact, Title, Subtitle, Author, Date, Abstract, Bibliography, Heading 1, Heading 2, Heading 3, Heading 4, Heading 5, Heading 6, Block Text, Footnote Text, Definition Term, Definition, Caption, Table Caption, Image Caption, Figure, Figure With Caption, TOC Heading; [character] Default Paragraph Font, Body Text Char, Verbatim Char, Footnote Reference, Hyperlink; [table] Normal Table.</p>
</dd>
<dt><code>--epub-stylesheet=</code><em>FILE</em></dt>
<dd><p>Use the specified CSS file to style the EPUB. If no stylesheet is specified, pandoc will look for a file <code>epub.css</code> in the user data directory (see <code>--data-dir</code>). If it is not found there, sensible defaults will be used.</p>
</dd>
<dt><code>--epub-cover-image=</code><em>FILE</em></dt>
<dd><p>Use the specified image as the EPUB cover. It is recommended that the image be less than 1000px in width and height. Note that in a Markdown source document you can also specify <code>cover-image</code> in a YAML metadata block (see <a href="#epub-metadata">EPUB Metadata</a>, below).</p>
</dd>
<dt><code>--epub-metadata=</code><em>FILE</em></dt>
<dd><p>Look in the specified XML file for metadata for the EPUB. The file should contain a series of <a href="http://dublincore.org/documents/dces/">Dublin Core elements</a>. For example:</p>
<pre><code> &lt;dc:rights&gt;Creative Commons&lt;/dc:rights&gt;
 &lt;dc:language&gt;es-AR&lt;/dc:language&gt;</code></pre>
<p>By default, pandoc will include the following metadata elements: <code>&lt;dc:title&gt;</code> (from the document title), <code>&lt;dc:creator&gt;</code> (from the document authors), <code>&lt;dc:date&gt;</code> (from the document date, which should be in <a href="http://www.w3.org/TR/NOTE-datetime">ISO 8601 format</a>), <code>&lt;dc:language&gt;</code> (from the <code>lang</code> variable, or, if is not set, the locale), and <code>&lt;dc:identifier id=&quot;BookId&quot;&gt;</code> (a randomly generated UUID). Any of these may be overridden by elements in the metadata file.</p>
<p>Note: if the source document is Markdown, a YAML metadata block in the document can be used instead. See below under <a href="#epub-metadata">EPUB Metadata</a>.</p>
</dd>
<dt><code>--epub-embed-font=</code><em>FILE</em></dt>
<dd><p>Embed the specified font in the EPUB. This option can be repeated to embed multiple fonts. Wildcards can also be used: for example, <code>DejaVuSans-*.ttf</code>. However, if you use wildcards on the command line, be sure to escape them or put the whole filename in single quotes, to prevent them from being interpreted by the shell. To use the embedded fonts, you will need to add declarations like the following to your CSS (see <code>--epub-stylesheet</code>):</p>
<pre><code>@font-face {
font-family: DejaVuSans;
font-style: normal;
font-weight: normal;
src:url(&quot;DejaVuSans-Regular.ttf&quot;);
}
@font-face {
font-family: DejaVuSans;
font-style: normal;
font-weight: bold;
src:url(&quot;DejaVuSans-Bold.ttf&quot;);
}
@font-face {
font-family: DejaVuSans;
font-style: italic;
font-weight: normal;
src:url(&quot;DejaVuSans-Oblique.ttf&quot;);
}
@font-face {
font-family: DejaVuSans;
font-style: italic;
font-weight: bold;
src:url(&quot;DejaVuSans-BoldOblique.ttf&quot;);
}
body { font-family: &quot;DejaVuSans&quot;; }</code></pre>
</dd>
<dt><code>--epub-chapter-level=</code><em>NUMBER</em></dt>
<dd><p>Specify the header level at which to split the EPUB into separate “chapter” files. The default is to split into chapters at level 1 headers. This option only affects the internal composition of the EPUB, not the way chapters and sections are displayed to users. Some readers may be slow if the chapter files are too large, so for large documents with few level 1 headers, one might want to use a chapter level of 2 or 3.</p>
</dd>
<dt><code>--latex-engine=pdflatex</code>|<code>lualatex</code>|<code>xelatex</code></dt>
<dd><p>Use the specified LaTeX engine when producing PDF output. The default is <code>pdflatex</code>. If the engine is not in your PATH, the full path of the engine may be specified here.</p>
</dd>
<dt><code>--latex-engine-opt=</code><em>STRING</em></dt>
<dd><p>Use the given string as a command-line argument to the <code>latex-engine</code>. If used multiple times, the arguments are provided with spaces between them. Note that no check for duplicate options is done.</p>
</dd>
</dl>
<h2 id="citation-rendering">Citation rendering</h2>
<dl>
<dt><code>--bibliography=</code><em>FILE</em></dt>
<dd><p>Set the <code>bibliography</code> field in the document’s metadata to <em>FILE</em>, overriding any value set in the metadata, and process citations using <code>pandoc-citeproc</code>. (This is equivalent to <code>--metadata bibliography=FILE --filter pandoc-citeproc</code>.) If <code>--natbib</code> or <code>--biblatex</code> is also supplied, <code>pandoc-citeproc</code> is not used, making this equivalent to <code>--metadata bibliography=FILE</code>. If you supply this argument multiple times, each <em>FILE</em> will be added to bibliography.</p>
</dd>
<dt><code>--csl=</code><em>FILE</em></dt>
<dd><p>Set the <code>csl</code> field in the document’s metadata to <em>FILE</em>, overriding any value set in the metadata. (This is equivalent to <code>--metadata csl=FILE</code>.) This option is only relevant with <code>pandoc-citeproc</code>.</p>
</dd>
<dt><code>--citation-abbreviations=</code><em>FILE</em></dt>
<dd><p>Set the <code>citation-abbreviations</code> field in the document’s metadata to <em>FILE</em>, overriding any value set in the metadata. (This is equivalent to <code>--metadata citation-abbreviations=FILE</code>.) This option is only relevant with <code>pandoc-citeproc</code>.</p>
</dd>
<dt><code>--natbib</code></dt>
<dd><p>Use <a href="https://ctan.org/pkg/natbib"><code>natbib</code></a> for citations in LaTeX output. This option is not for use with the <code>pandoc-citeproc</code> filter or with PDF output. It is intended for use in producing a LaTeX file that can be processed with <a href="https://ctan.org/pkg/bibtex"><code>bibtex</code></a>.</p>
</dd>
<dt><code>--biblatex</code></dt>
<dd><p>Use <a href="https://ctan.org/pkg/biblatex"><code>biblatex</code></a> for citations in LaTeX output. This option is not for use with the <code>pandoc-citeproc</code> filter or with PDF output. It is intended for use in producing a LaTeX file that can be processed with <a href="https://ctan.org/pkg/bibtex"><code>bibtex</code></a> or <a href="https://ctan.org/pkg/biber"><code>biber</code></a>.</p>
</dd>
</dl>
<h2 id="math-rendering-in-html">Math rendering in HTML</h2>
<dl>
<dt><code>-m</code> [<em>URL</em>], <code>--latexmathml</code>[<code>=</code><em>URL</em>]</dt>
<dd><p>Use the <a href="http://math.etsu.edu/LaTeXMathML/">LaTeXMathML</a> script to display embedded TeX math in HTML output. To insert a link to a local copy of the <code>LaTeXMathML.js</code> script, provide a <em>URL</em>. If no <em>URL</em> is provided, the contents of the script will be inserted directly into the HTML header, preserving portability at the price of efficiency. If you plan to use math on several pages, it is much better to link to a copy of the script, so it can be cached.</p>
</dd>
<dt><code>--mathml</code>[<code>=</code><em>URL</em>]</dt>
<dd><p>Convert TeX math to <a href="http://www.w3.org/Math/">MathML</a> (in <code>docbook</code>, <code>docbook5</code>, <code>html</code> and <code>html5</code>). In standalone <code>html</code> output, a small JavaScript (or a link to such a script if a <em>URL</em> is supplied) will be inserted that allows the MathML to be viewed on some browsers.</p>
</dd>
<dt><code>--jsmath</code>[<code>=</code><em>URL</em>]</dt>
<dd><p>Use <a href="http://www.math.union.edu/~dpvc/jsmath/">jsMath</a> to display embedded TeX math in HTML output. The <em>URL</em> should point to the jsMath load script (e.g. <code>jsMath/easy/load.js</code>); if provided, it will be linked to in the header of standalone HTML documents. If a <em>URL</em> is not provided, no link to the jsMath load script will be inserted; it is then up to the author to provide such a link in the HTML template.</p>
</dd>
<dt><code>--mathjax</code>[<code>=</code><em>URL</em>]</dt>
<dd><p>Use <a href="https://www.mathjax.org">MathJax</a> to display embedded TeX math in HTML output. The <em>URL</em> should point to the <code>MathJax.js</code> load script. If a <em>URL</em> is not provided, a link to the MathJax CDN will be inserted.</p>
</dd>
<dt><code>--gladtex</code></dt>
<dd><p>Enclose TeX math in <code>&lt;eq&gt;</code> tags in HTML output. These can then be processed by <a href="http://ans.hsh.no/home/mgg/gladtex/">gladTeX</a> to produce links to images of the typeset formulas.</p>
</dd>
<dt><code>--mimetex</code>[<code>=</code><em>URL</em>]</dt>
<dd><p>Render TeX math using the <a href="http://www.forkosh.com/mimetex.html">mimeTeX</a> CGI script. If <em>URL</em> is not specified, it is assumed that the script is at <code>/cgi-bin/mimetex.cgi</code>.</p>
</dd>
<dt><code>--webtex</code>[<code>=</code><em>URL</em>]</dt>
<dd><p>Render TeX formulas using an external script that converts TeX formulas to images. The formula will be concatenated with the URL provided. If <em>URL</em> is not specified, the CodeCogs will be used. Note: the <code>--webtex</code> option will affect Markdown output as well as HTML, which is useful if you’re targeting a version of Markdown without native math support.</p>
</dd>
<dt><code>--katex</code>[<code>=</code><em>URL</em>]</dt>
<dd><p>Use <a href="https://github.com/Khan/KaTeX">KaTeX</a> to display embedded TeX math in HTML output. The <em>URL</em> should point to the <code>katex.js</code> load script. If a <em>URL</em> is not provided, a link to the KaTeX CDN will be inserted. Note: <a href="https://github.com/Khan/KaTeX">KaTeX</a> seems to work best with <code>html5</code> output.</p>
</dd>
<dt><code>--katex-stylesheet=</code><em>URL</em></dt>
<dd><p>The <em>URL</em> should point to the <code>katex.css</code> stylesheet. If this option is not specified, a link to the KaTeX CDN will be inserted. Note that this option does not imply <code>--katex</code>.</p>
</dd>
</dl>
<h2 id="options-for-wrapper-scripts">Options for wrapper scripts</h2>
<dl>
<dt><code>--dump-args</code></dt>
<dd><p>Print information about command-line arguments to <em>stdout</em>, then exit. This option is intended primarily for use in wrapper scripts. The first line of output contains the name of the output file specified with the <code>-o</code> option, or <code>-</code> (for <em>stdout</em>) if no output file was specified. The remaining lines contain the command-line arguments, one per line, in the order they appear. These do not include regular pandoc options and their arguments, but do include any options appearing after a <code>--</code> separator at the end of the line.</p>
</dd>
<dt><code>--ignore-args</code></dt>
<dd><p>Ignore command-line arguments (for use in wrapper scripts). Regular pandoc options are not ignored. Thus, for example,</p>
<pre><code>pandoc --ignore-args -o foo.html -s foo.txt -- -e latin1</code></pre>
<p>is equivalent to</p>
<pre><code>pandoc -o foo.html -s</code></pre>
</dd>
</dl>
<h1 id="templates">Templates</h1>
<p>When the <code>-s/--standalone</code> option is used, pandoc uses a template to add header and footer material that is needed for a self-standing document. To see the default template that is used, just type</p>
<pre><code>pandoc -D *FORMAT*</code></pre>
<p>where <em>FORMAT</em> is the name of the output format. A custom template can be specified using the <code>--template</code> option. You can also override the system default templates for a given output format <em>FORMAT</em> by putting a file <code>templates/default.*FORMAT*</code> in the user data directory (see <code>--data-dir</code>, above). <em>Exceptions:</em></p>
<ul>
<li>For <code>odt</code> output, customize the <code>default.opendocument</code> template.</li>
<li>For <code>pdf</code> output, customize the <code>default.latex</code> template (or the <code>default.beamer</code> template, if you use <code>-t beamer</code>, or the <code>default.context</code> template, if you use <code>-t context</code>).</li>
<li><code>docx</code> has no template (however, you can use <code>--reference-docx</code> to customize the output).</li>
</ul>
<p>Templates contain <em>variables</em>, which allow for the inclusion of arbitrary information at any point in the file. Variables may be set within the document using <a href="#extension-yaml_metadata_block">YAML metadata blocks</a>. They may also be set at the command line using the <code>-V/--variable</code> option: variables set in this way override metadata fields with the same name.</p>
<h2 id="variables-set-by-pandoc">Variables set by pandoc</h2>
<p>Some variables are set automatically by pandoc. These vary somewhat depending on the output format, but include metadata fields as well as the following:</p>
<dl>
<dt><code>title</code>, <code>author</code>, <code>date</code></dt>
<dd><p>allow identification of basic aspects of the document. Included in PDF metadata through LaTeX and ConTeXt. These can be set through a <a href="#extension-pandoc_title_block">pandoc title block</a>, which allows for multiple authors, or through a YAML metadata block:</p>
<pre><code>---
author:
- Aristotle
- Peter Abelard
...</code></pre>
</dd>
<dt><code>subtitle</code></dt>
<dd>document subtitle, included in HTML, EPUB, LaTeX, ConTeXt, and Word docx; renders in LaTeX only when using a document class that supports <code>\subtitle</code>, such as <code>beamer</code> or the <a href="https://ctan.org/pkg/koma-script">KOMA-Script</a> series (<code>scrartcl</code>, <code>scrreprt</code>, <code>scrbook</code>).<a href="#fn1" class="footnoteRef" id="fnref1"><sup>1</sup></a>
</dd>
<dt><code>institute</code></dt>
<dd>author affiliations (in LaTeX and Beamer only). Can be a list, when there are multiple authors.
</dd>
<dt><code>abstract</code></dt>
<dd>document summary, included in LaTeX, ConTeXt, AsciiDoc, and Word docx
</dd>
<dt><code>keywords</code></dt>
<dd>list of keywords to be included in HTML, PDF, and AsciiDoc metadata; may be repeated as for <code>author</code>, above
</dd>
<dt><code>header-includes</code></dt>
<dd>contents specified by <code>-H/--include-in-header</code> (may have multiple values)
</dd>
<dt><code>toc</code></dt>
<dd>non-null value if <code>--toc/--table-of-contents</code> was specified
</dd>
<dt><code>toc-title</code></dt>
<dd>title of table of contents (works only with EPUB and docx)
</dd>
<dt><code>include-before</code></dt>
<dd>contents specified by <code>-B/--include-before-body</code> (may have multiple values)
</dd>
<dt><code>include-after</code></dt>
<dd>contents specified by <code>-A/--include-after-body</code> (may have multiple values)
</dd>
<dt><code>body</code></dt>
<dd>body of document
</dd>
<dt><code>meta-json</code></dt>
<dd>JSON representation of all of the document’s metadata
</dd>
</dl>
<h2 id="language-variables">Language variables</h2>
<dl>
<dt><code>lang</code></dt>
<dd><p>identifies the main language of the document, using a code according to <a href="https://tools.ietf.org/html/bcp47">BCP 47</a> (e.g. <code>en</code> or <code>en-GB</code>). For some output formats, pandoc will convert it to an appropriate format stored in the additional variables <code>babel-lang</code>, <code>polyglossia-lang</code> (LaTeX) and <code>context-lang</code> (ConTeXt).</p>
<p>Native pandoc <code>span</code>s and <code>div</code>s with the lang attribute (value in BCP 47) can be used to switch the language in that range.</p>
</dd>
<dt><code>otherlangs</code></dt>
<dd>a list of other languages used in the document in the YAML metadata, according to <a href="https://tools.ietf.org/html/bcp47">BCP 47</a>. For example: <code>otherlangs: [en-GB, fr]</code>. This is automatically generated from the <code>lang</code> attributes in all <code>span</code>s and <code>div</code>s but can be overridden. Currently only used by LaTeX through the generated <code>babel-otherlangs</code> and <code>polyglossia-otherlangs</code> variables. The LaTeX writer outputs polyglossia commands in the text but the <code>babel-newcommands</code> variable contains mappings for them to the corresponding babel.
</dd>
<dt><code>dir</code></dt>
<dd><p>the base direction of the document, either <code>rtl</code> (right-to-left) or <code>ltr</code> (left-to-right).</p>
<p>For bidirectional documents, native pandoc <code>span</code>s and <code>div</code>s with the <code>dir</code> attribute (value <code>rtl</code> or <code>ltr</code>) can be used to override the base direction in some output formats. This may not always be necessary if the final renderer (e.g. the browser, when generating HTML) supports the <a href="http://www.w3.org/International/articles/inline-bidi-markup/uba-basics">Unicode Bidirectional Algorithm</a>.</p>
<p>When using LaTeX for bidirectional documents, only the <code>xelatex</code> engine is fully supported (use <code>--latex-engine=xelatex</code>).</p>
</dd>
</dl>
<h2 id="variables-for-slides">Variables for slides</h2>
<p>Variables are available for <a href="#producing-slide-shows-with-pandoc">producing slide shows with pandoc</a>, including all <a href="https://github.com/hakimel/reveal.js#configuration">reveal.js configuration options</a>.</p>
<dl>
<dt><code>slidy-url</code></dt>
<dd>base URL for Slidy documents (defaults to <code>http://www.w3.org/Talks/Tools/Slidy2</code>)
</dd>
<dt><code>slideous-url</code></dt>
<dd>base URL for Slideous documents (defaults to <code>slideous</code>)
</dd>
<dt><code>s5-url</code></dt>
<dd>base URL for S5 documents (defaults to <code>s5/default</code>)
</dd>
<dt><code>revealjs-url</code></dt>
<dd>base URL for reveal.js documents (defaults to <code>reveal.js</code>)
</dd>
<dt><code>theme</code>, <code>colortheme</code>, <code>fonttheme</code>, <code>innertheme</code>, <code>outertheme</code></dt>
<dd>themes for LaTeX <a href="https://ctan.org/pkg/beamer"><code>beamer</code></a> documents
</dd>
<dt><code>themeoptions</code></dt>
<dd>options for LaTeX beamer themes (a list).
</dd>
<dt><code>navigation</code></dt>
<dd>controls navigation symbols in <code>beamer</code> documents (default is <code>empty</code> for no navigation symbols; other valid values are <code>frame</code>, <code>vertical</code>, and <code>horizontal</code>).
</dd>
<dt><code>section-titles</code></dt>
<dd>enables on “title pages” for new sections in <code>beamer</code> documents (default = true).
</dd>
<dt><code>beamerarticle</code></dt>
<dd>when true, the <code>beamerarticle</code> package is loaded (for producing an article from beamer slides).
</dd>
<dt><code>colorlinks</code></dt>
<dd>add color to link text; automatically enabled if any of <code>linkcolor</code>, <code>citecolor</code>, <code>urlcolor</code>, or <code>toccolor</code> are set (for beamer only).
</dd>
<dt><code>linkcolor</code>, <code>citecolor</code>, <code>urlcolor</code>, <code>toccolor</code></dt>
<dd>color for internal links, citation links, external links, and links in table of contents: uses any of the <a href="https://en.wikibooks.org/wiki/LaTeX/Colors#Predefined_colors">predefined LaTeX colors</a> (for beamer only).
</dd>
</dl>
<h2 id="variables-for-latex">Variables for LaTeX</h2>
<p>LaTeX variables are used when <a href="#creating-a-pdf">creating a PDF</a>.</p>
<dl>
<dt><code>papersize</code></dt>
<dd>paper size, e.g. <code>letter</code>, <code>A4</code>
</dd>
<dt><code>fontsize</code></dt>
<dd>font size for body text (e.g. <code>10pt</code>, <code>12pt</code>)
</dd>
<dt><code>documentclass</code></dt>
<dd>document class, e.g. <a href="https://ctan.org/pkg/article"><code>article</code></a>, <a href="https://ctan.org/pkg/report"><code>report</code></a>, <a href="https://ctan.org/pkg/book"><code>book</code></a>, <a href="https://ctan.org/pkg/memoir"><code>memoir</code></a>
</dd>
<dt><code>classoption</code></dt>
<dd>option for document class, e.g. <code>oneside</code>; may be repeated for multiple options
</dd>
<dt><code>geometry</code></dt>
<dd>option for <a href="https://ctan.org/pkg/geometry"><code>geometry</code></a> package, e.g. <code>margin=1in</code>; may be repeated for multiple options
</dd>
<dt><code>margin-left</code>, <code>margin-right</code>, <code>margin-top</code>, <code>margin-bottom</code></dt>
<dd>sets margins, if <code>geometry</code> is not used (otherwise <code>geometry</code> overrides these)
</dd>
<dt><code>linestretch</code></dt>
<dd>adjusts line spacing using the <a href="https://ctan.org/pkg/setspace"><code>setspace</code></a> package, e.g. <code>1.25</code>, <code>1.5</code>
</dd>
<dt><code>fontfamily</code></dt>
<dd>font package for use with <code>pdflatex</code>: <a href="http://www.tug.org/texlive/">TeX Live</a> includes many options, documented in the <a href="http://www.tug.dk/FontCatalogue/">LaTeX Font Catalogue</a>. The default is <a href="https://ctan.org/pkg/lm">Latin Modern</a>.
</dd>
<dt><code>fontfamilyoptions</code></dt>
<dd>options for package used as <code>fontfamily</code>: e.g. <code>osf,sc</code> with <code>fontfamily</code> set to <a href="https://ctan.org/pkg/mathpazo"><code>mathpazo</code></a> provides Palatino with old-style figures and true small caps; may be repeated for multiple options
</dd>
<dt><code>mainfont</code>, <code>sansfont</code>, <code>monofont</code>, <code>mathfont</code>, <code>CJKmainfont</code></dt>
<dd>font families for use with <code>xelatex</code> or <code>lualatex</code>: take the name of any system font, using the <a href="https://ctan.org/pkg/fontspec"><code>fontspec</code></a> package. Note that if <code>CJKmainfont</code> is used, the <a href="https://ctan.org/pkg/xecjk"><code>xecjk</code></a> package must be available.
</dd>
<dt><code>mainfontoptions</code>, <code>sansfontoptions</code>, <code>monofontoptions</code>, <code>mathfontoptions</code>, <code>CJKoptions</code></dt>
<dd>options to use with <code>mainfont</code>, <code>sansfont</code>, <code>monofont</code>, <code>mathfont</code>, <code>CJKmainfont</code> in <code>xelatex</code> and <code>lualatex</code>. Allow for any choices available through <a href="https://ctan.org/pkg/fontspec"><code>fontspec</code></a>, such as the OpenType features <code>Numbers=OldStyle,Numbers=Proportional</code>. May be repeated for multiple options.
</dd>
<dt><code>fontenc</code></dt>
<dd>allows font encoding to be specified through <code>fontenc</code> package (with <code>pdflatex</code>); default is <code>T1</code> (see guide to <a href="https://ctan.org/pkg/encguide">LaTeX font encodings</a>)
</dd>
<dt><code>microtypeoptions</code></dt>
<dd>options to pass to the microtype package
</dd>
<dt><code>colorlinks</code></dt>
<dd>add color to link text; automatically enabled if any of <code>linkcolor</code>, <code>citecolor</code>, <code>urlcolor</code>, or <code>toccolor</code> are set
</dd>
<dt><code>linkcolor</code>, <code>citecolor</code>, <code>urlcolor</code>, <code>toccolor</code></dt>
<dd>color for internal links, citation links, external links, and links in table of contents: uses any of the <a href="https://en.wikibooks.org/wiki/LaTeX/Colors#Predefined_colors">predefined LaTeX colors</a>
</dd>
<dt><code>links-as-notes</code></dt>
<dd>causes links to be printed as footnotes
</dd>
<dt><code>indent</code></dt>
<dd>uses document class settings for indentation (the default LaTeX template otherwise removes indentation and adds space between paragraphs)
</dd>
<dt><code>subparagraph</code></dt>
<dd>disables default behavior of LaTeX template that redefines (sub)paragraphs as sections, changing the appearance of nested headings in some classes
</dd>
<dt><code>thanks</code></dt>
<dd>specifies contents of acknowledgments footnote after document title.
</dd>
<dt><code>toc</code></dt>
<dd>include table of contents (can also be set using <code>--toc/--table-of-contents</code>)
</dd>
<dt><code>toc-depth</code></dt>
<dd>level of section to include in table of contents
</dd>
<dt><code>secnumdepth</code></dt>
<dd>numbering depth for sections, if sections are numbered
</dd>
<dt><code>lof</code>, <code>lot</code></dt>
<dd>include list of figures, list of tables
</dd>
<dt><code>bibliography</code></dt>
<dd>bibliography to use for resolving references
</dd>
<dt><code>biblio-style</code></dt>
<dd>bibliography style, when used with <code>--natbib</code> and <code>--biblatex</code>.
</dd>
<dt><code>biblio-title</code></dt>
<dd>bibliography title, when used with <code>--natbib</code> and <code>--biblatex</code>.
</dd>
<dt><code>biblatexoptions</code></dt>
<dd>list of options for biblatex.
</dd>
</dl>
<h2 id="variables-for-context">Variables for ConTeXt</h2>
<dl>
<dt><code>papersize</code></dt>
<dd>paper size, e.g. <code>letter</code>, <code>A4</code>, <code>landscape</code> (see <a href="http://wiki.contextgarden.net/PaperSetup">ConTeXt Paper Setup</a>); may be repeated for multiple options
</dd>
<dt><code>layout</code></dt>
<dd>options for page margins and text arrangement (see <a href="http://wiki.contextgarden.net/Layout">ConTeXt Layout</a>); may be repeated for multiple options
</dd>
<dt><code>margin-left</code>, <code>margin-right</code>, <code>margin-top</code>, <code>margin-bottom</code></dt>
<dd>sets margins, if <code>layout</code> is not used (otherwise <code>layout</code> overrides these)
</dd>
<dt><code>fontsize</code></dt>
<dd>font size for body text (e.g. <code>10pt</code>, <code>12pt</code>)
</dd>
<dt><code>mainfont</code>, <code>sansfont</code>, <code>monofont</code>, <code>mathfont</code></dt>
<dd>font families: take the name of any system font (see <a href="http://wiki.contextgarden.net/Font_Switching">ConTeXt Font Switching</a>)
</dd>
<dt><code>linkcolor</code>, <code>contrastcolor</code></dt>
<dd>color for links outside and inside a page, e.g. <code>red</code>, <code>blue</code> (see <a href="http://wiki.contextgarden.net/Color">ConTeXt Color</a>)
</dd>
<dt><code>linkstyle</code></dt>
<dd>typeface style for links, e.g. <code>normal</code>, <code>bold</code>, <code>slanted</code>, <code>boldslanted</code>, <code>type</code>, <code>cap</code>, <code>small</code>
</dd>
<dt><code>indenting</code></dt>
<dd>controls indentation of paragraphs, e.g. <code>yes,small,next</code> (see <a href="http://wiki.contextgarden.net/Indentation">ConTeXt Indentation</a>); may be repeated for multiple options
</dd>
<dt><code>whitespace</code></dt>
<dd>spacing between paragraphs, e.g. <code>none</code>, <code>small</code> (using <a href="http://wiki.contextgarden.net/Command/setupwhitespace"><code>setupwhitespace</code></a>)
</dd>
<dt><code>interlinespace</code></dt>
<dd>adjusts line spacing, e.g. <code>4ex</code> (using <a href="http://wiki.contextgarden.net/Command/setupinterlinespace"><code>setupinterlinespace</code></a>); may be repeated for multiple options
</dd>
<dt><code>headertext</code>, <code>footertext</code></dt>
<dd>text to be placed in running header or footer (see <a href="http://wiki.contextgarden.net/Headers_and_Footers">ConTeXt Headers and Footers</a>); may be repeated up to four times for different placement
</dd>
<dt><code>pagenumbering</code></dt>
<dd>page number style and location (using <a href="http://wiki.contextgarden.net/Command/setuppagenumbering"><code>setuppagenumbering</code></a>); may be repeated for multiple options
</dd>
<dt><code>toc</code></dt>
<dd>include table of contents (can also be set using <code>--toc/--table-of-contents</code>)
</dd>
<dt><code>lof</code>, <code>lot</code></dt>
<dd>include list of figures, list of tables
</dd>
</dl>
<h2 id="variables-for-man-pages">Variables for man pages</h2>
<dl>
<dt><code>section</code></dt>
<dd>section number in man pages
</dd>
<dt><code>header</code></dt>
<dd>header in man pages
</dd>
<dt><code>footer</code></dt>
<dd>footer in man pages
</dd>
<dt><code>adjusting</code></dt>
<dd>adjusts text to left (<code>l</code>), right (<code>r</code>), center (<code>c</code>), or both (<code>b</code>) margins
</dd>
<dt><code>hyphenate</code></dt>
<dd>if <code>true</code> (the default), hyphenation will be used
</dd>
</dl>
<h2 id="using-variables-in-templates">Using variables in templates</h2>
<p>Variable names are sequences of alphanumerics, <code>-</code>, and <code>_</code>, starting with a letter. A variable name surrounded by <code>$</code> signs will be replaced by its value. For example, the string <code>$title$</code> in</p>
<pre><code>&lt;title&gt;$title$&lt;/title&gt;</code></pre>
<p>will be replaced by the document title.</p>
<p>To write a literal <code>$</code> in a template, use <code>$$</code>.</p>
<p>Templates may contain conditionals. The syntax is as follows:</p>
<pre><code>$if(variable)$
X
$else$
Y
$endif$</code></pre>
<p>This will include <code>X</code> in the template if <code>variable</code> has a non-null value; otherwise it will include <code>Y</code>. <code>X</code> and <code>Y</code> are placeholders for any valid template text, and may include interpolated variables or other conditionals. The <code>$else$</code> section may be omitted.</p>
<p>When variables can have multiple values (for example, <code>author</code> in a multi-author document), you can use the <code>$for$</code> keyword:</p>
<pre><code>$for(author)$
&lt;meta name=&quot;author&quot; content=&quot;$author$&quot; /&gt;
$endfor$</code></pre>
<p>You can optionally specify a separator to be used between consecutive items:</p>
<pre><code>$for(author)$$author$$sep$, $endfor$</code></pre>
<p>A dot can be used to select a field of a variable that takes an object as its value. So, for example:</p>
<pre><code>$author.name$ ($author.affiliation$)</code></pre>
<p>If you use custom templates, you may need to revise them as pandoc changes. We recommend tracking the changes in the default templates, and modifying your custom templates accordingly. An easy way to do this is to fork the <a href="https://github.com/jgm/pandoc-templates">pandoc-templates</a> repository and merge in changes after each pandoc release.</p>
<h1 id="pandocs-markdown">Pandoc’s Markdown</h1>
<p>Pandoc understands an extended and slightly revised version of John Gruber’s <a href="http://daringfireball.net/projects/markdown/">Markdown</a> syntax. This document explains the syntax, noting differences from standard Markdown. Except where noted, these differences can be suppressed by using the <code>markdown_strict</code> format instead of <code>markdown</code>. An extensions can be enabled by adding <code>+EXTENSION</code> to the format name and disabled by adding <code>-EXTENSION</code>. For example, <code>markdown_strict+footnotes</code> is strict Markdown with footnotes enabled, while <code>markdown-footnotes-pipe_tables</code> is pandoc’s Markdown without footnotes or pipe tables.</p>
<h2 id="philosophy">Philosophy</h2>
<p>Markdown is designed to be easy to write, and, even more importantly, easy to read:</p>
<blockquote>
<p>A Markdown-formatted document should be publishable as-is, as plain text, without looking like it’s been marked up with tags or formatting instructions. – <a href="http://daringfireball.net/projects/markdown/syntax#philosophy">John Gruber</a></p>
</blockquote>
<p>This principle has guided pandoc’s decisions in finding syntax for tables, footnotes, and other extensions.</p>
<p>There is, however, one respect in which pandoc’s aims are different from the original aims of Markdown. Whereas Markdown was originally designed with HTML generation in mind, pandoc is designed for multiple output formats. Thus, while pandoc allows the embedding of raw HTML, it discourages it, and provides other, non-HTMLish ways of representing important document elements like definition lists, tables, mathematics, and footnotes.</p>
<h2 id="paragraphs">Paragraphs</h2>
<p>A paragraph is one or more lines of text followed by one or more blank lines. Newlines are treated as spaces, so you can reflow your paragraphs as you like. If you need a hard line break, put two or more spaces at the end of a line.</p>
<h4 id="extension-escaped_line_breaks">Extension: <code>escaped_line_breaks</code></h4>
<p>A backslash followed by a newline is also a hard line break. Note: in multiline and grid table cells, this is the only way to create a hard line break, since trailing spaces in the cells are ignored.</p>
<h2 id="headers">Headers</h2>
<p>There are two kinds of headers: Setext and ATX.</p>
<h3 id="setext-style-headers">Setext-style headers</h3>
<p>A setext-style header is a line of text “underlined” with a row of <code>=</code> signs (for a level one header) or <code>-</code> signs (for a level two header):</p>
<pre><code>A level-one header
==================

A level-two header
------------------</code></pre>
<p>The header text can contain inline formatting, such as emphasis (see <a href="#inline-formatting">Inline formatting</a>, below).</p>
<h3 id="atx-style-headers">ATX-style headers</h3>
<p>An ATX-style header consists of one to six <code>#</code> signs and a line of text, optionally followed by any number of <code>#</code> signs. The number of <code>#</code> signs at the beginning of the line is the header level:</p>
<pre><code>## A level-two header

### A level-three header ###</code></pre>
<p>As with setext-style headers, the header text can contain formatting:</p>
<pre><code># A level-one header with a [link](/url) and *emphasis*</code></pre>
<h4 id="extension-blank_before_header">Extension: <code>blank_before_header</code></h4>
<p>Standard Markdown syntax does not require a blank line before a header. Pandoc does require this (except, of course, at the beginning of the document). The reason for the requirement is that it is all too easy for a <code>#</code> to end up at the beginning of a line by accident (perhaps through line wrapping). Consider, for example:</p>
<pre><code>I like several of their flavors of ice cream:
#22, for example, and #5.</code></pre>
<h3 id="header-identifiers">Header identifiers</h3>
<h4 id="extension-header_attributes">Extension: <code>header_attributes</code></h4>
<p>Headers can be assigned attributes using this syntax at the end of the line containing the header text:</p>
<pre><code>{#identifier .class .class key=value key=value}</code></pre>
<p>Thus, for example, the following headers will all be assigned the identifier <code>foo</code>:</p>
<pre><code># My header {#foo}

## My header ##    {#foo}

My other header   {#foo}
---------------</code></pre>
<p>(This syntax is compatible with <a href="https://michelf.ca/projects/php-markdown/extra/">PHP Markdown Extra</a>.)</p>
<p>Note that although this syntax allows assignment of classes and key/value attributes, writers generally don’t use all of this information. Identifiers, classes, and key/value attributes are used in HTML and HTML-based formats such as EPUB and slidy. Identifiers are used for labels and link anchors in the LaTeX, ConTeXt, Textile, and AsciiDoc writers.</p>
<p>Headers with the class <code>unnumbered</code> will not be numbered, even if <code>--number-sections</code> is specified. A single hyphen (<code>-</code>) in an attribute context is equivalent to <code>.unnumbered</code>, and preferable in non-English documents. So,</p>
<pre><code># My header {-}</code></pre>
<p>is just the same as</p>
<pre><code># My header {.unnumbered}</code></pre>
<h4 id="extension-auto_identifiers">Extension: <code>auto_identifiers</code></h4>
<p>A header without an explicitly specified identifier will be automatically assigned a unique identifier based on the header text. To derive the identifier from the header text,</p>
<ul>
<li>Remove all formatting, links, etc.</li>
<li>Remove all footnotes.</li>
<li>Remove all punctuation, except underscores, hyphens, and periods.</li>
<li>Replace all spaces and newlines with hyphens.</li>
<li>Convert all alphabetic characters to lowercase.</li>
<li>Remove everything up to the first letter (identifiers may not begin with a number or punctuation mark).</li>
<li>If nothing is left after this, use the identifier <code>section</code>.</li>
</ul>
<p>Thus, for example,</p>
<table>
<thead>
<tr class="header">
<th align="left">Header</th>
<th align="left">Identifier</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="left"><code>Header identifiers in HTML</code></td>
<td align="left"><code>header-identifiers-in-html</code></td>
</tr>
<tr class="even">
<td align="left"><code>*Dogs*?--in *my* house?</code></td>
<td align="left"><code>dogs--in-my-house</code></td>
</tr>
<tr class="odd">
<td align="left"><code>[HTML], [S5], or [RTF]?</code></td>
<td align="left"><code>html-s5-or-rtf</code></td>
</tr>
<tr class="even">
<td align="left"><code>3. Applications</code></td>
<td align="left"><code>applications</code></td>
</tr>
<tr class="odd">
<td align="left"><code>33</code></td>
<td align="left"><code>section</code></td>
</tr>
</tbody>
</table>
<p>These rules should, in most cases, allow one to determine the identifier from the header text. The exception is when several headers have the same text; in this case, the first will get an identifier as described above; the second will get the same identifier with <code>-1</code> appended; the third with <code>-2</code>; and so on.</p>
<p>These identifiers are used to provide link targets in the table of contents generated by the <code>--toc|--table-of-contents</code> option. They also make it easy to provide links from one section of a document to another. A link to this section, for example, might look like this:</p>
<pre><code>See the section on
[header identifiers](#header-identifiers-in-html-latex-and-context).</code></pre>
<p>Note, however, that this method of providing links to sections works only in HTML, LaTeX, and ConTeXt formats.</p>
<p>If the <code>--section-divs</code> option is specified, then each section will be wrapped in a <code>div</code> (or a <code>section</code>, if <code>--html5</code> was specified), and the identifier will be attached to the enclosing <code>&lt;div&gt;</code> (or <code>&lt;section&gt;</code>) tag rather than the header itself. This allows entire sections to be manipulated using JavaScript or treated differently in CSS.</p>
<h4 id="extension-implicit_header_references">Extension: <code>implicit_header_references</code></h4>
<p>Pandoc behaves as if reference links have been defined for each header. So, to link to a header</p>
<pre><code># Header identifiers in HTML</code></pre>
<p>you can simply write</p>
<pre><code>[Header identifiers in HTML]</code></pre>
<p>or</p>
<pre><code>[Header identifiers in HTML][]</code></pre>
<p>or</p>
<pre><code>[the section on header identifiers][header identifiers in
HTML]</code></pre>
<p>instead of giving the identifier explicitly:</p>
<pre><code>[Header identifiers in HTML](#header-identifiers-in-html)</code></pre>
<p>If there are multiple headers with identical text, the corresponding reference will link to the first one only, and you will need to use explicit links to link to the others, as described above.</p>
<p>Like regular reference links, these references are case-insensitive.</p>
<p>Explicit link reference definitions always take priority over implicit header references. So, in the following example, the link will point to <code>bar</code>, not to <code>#foo</code>:</p>
<pre><code># Foo

[foo]: bar

See [foo]</code></pre>
<h2 id="block-quotations">Block quotations</h2>
<p>Markdown uses email conventions for quoting blocks of text. A block quotation is one or more paragraphs or other block elements (such as lists or headers), with each line preceded by a <code>&gt;</code> character and an optional space. (The <code>&gt;</code> need not start at the left margin, but it should not be indented more than three spaces.)</p>
<pre><code>&gt; This is a block quote. This
&gt; paragraph has two lines.
&gt;
&gt; 1. This is a list inside a block quote.
&gt; 2. Second item.</code></pre>
<p>A “lazy” form, which requires the <code>&gt;</code> character only on the first line of each block, is also allowed:</p>
<pre><code>&gt; This is a block quote. This
paragraph has two lines.

&gt; 1. This is a list inside a block quote.
2. Second item.</code></pre>
<p>Among the block elements that can be contained in a block quote are other block quotes. That is, block quotes can be nested:</p>
<pre><code>&gt; This is a block quote.
&gt;
&gt; &gt; A block quote within a block quote.</code></pre>
<p>If the <code>&gt;</code> character is followed by an optional space, that space will be considered part of the block quote marker and not part of the indentation of the contents. Thus, to put an indented code block in a block quote, you need five spaces after the <code>&gt;</code>:</p>
<pre><code>&gt;     code</code></pre>
<h4 id="extension-blank_before_blockquote">Extension: <code>blank_before_blockquote</code></h4>
<p>Standard Markdown syntax does not require a blank line before a block quote. Pandoc does require this (except, of course, at the beginning of the document). The reason for the requirement is that it is all too easy for a <code>&gt;</code> to end up at the beginning of a line by accident (perhaps through line wrapping). So, unless the <code>markdown_strict</code> format is used, the following does not produce a nested block quote in pandoc:</p>
<pre><code>&gt; This is a block quote.
&gt;&gt; Nested.</code></pre>
<h2 id="verbatim-code-blocks">Verbatim (code) blocks</h2>
<h3 id="indented-code-blocks">Indented code blocks</h3>
<p>A block of text indented four spaces (or one tab) is treated as verbatim text: that is, special characters do not trigger special formatting, and all spaces and line breaks are preserved. For example,</p>
<pre><code>    if (a &gt; 3) {
      moveShip(5 * gravity, DOWN);
    }</code></pre>
<p>The initial (four space or one tab) indentation is not considered part of the verbatim text, and is removed in the output.</p>
<p>Note: blank lines in the verbatim text need not begin with four spaces.</p>
<h3 id="fenced-code-blocks">Fenced code blocks</h3>
<h4 id="extension-fenced_code_blocks">Extension: <code>fenced_code_blocks</code></h4>
<p>In addition to standard indented code blocks, pandoc supports <em>fenced</em> code blocks. These begin with a row of three or more tildes (<code>~</code>) and end with a row of tildes that must be at least as long as the starting row. Everything between these lines is treated as code. No indentation is necessary:</p>
<pre><code>~~~~~~~
if (a &gt; 3) {
  moveShip(5 * gravity, DOWN);
}
~~~~~~~</code></pre>
<p>Like regular code blocks, fenced code blocks must be separated from surrounding text by blank lines.</p>
<p>If the code itself contains a row of tildes or backticks, just use a longer row of tildes or backticks at the start and end:</p>
<pre><code>~~~~~~~~~~~~~~~~
~~~~~~~~~~
code including tildes
~~~~~~~~~~
~~~~~~~~~~~~~~~~</code></pre>
<h4 id="extension-backtick_code_blocks">Extension: <code>backtick_code_blocks</code></h4>
<p>Same as <code>fenced_code_blocks</code>, but uses backticks (<code>`</code>) instead of tildes (<code>~</code>).</p>
<h4 id="extension-fenced_code_attributes">Extension: <code>fenced_code_attributes</code></h4>
<p>Optionally, you may attach attributes to fenced or backtick code block using this syntax:</p>
<pre><code>~~~~ {#mycode .haskell .numberLines startFrom=&quot;100&quot;}
qsort []     = []
qsort (x:xs) = qsort (filter (&lt; x) xs) ++ [x] ++
               qsort (filter (&gt;= x) xs)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</code></pre>
<p>Here <code>mycode</code> is an identifier, <code>haskell</code> and <code>numberLines</code> are classes, and <code>startFrom</code> is an attribute with value <code>100</code>. Some output formats can use this information to do syntax highlighting. Currently, the only output formats that uses this information are HTML and LaTeX. If highlighting is supported for your output format and language, then the code block above will appear highlighted, with numbered lines. (To see which languages are supported, type <code>pandoc --list-highlight-languages</code>.) Otherwise, the code block above will appear as follows:</p>
<pre><code>&lt;pre id=&quot;mycode&quot; class=&quot;haskell numberLines&quot; startFrom=&quot;100&quot;&gt;
  &lt;code&gt;
  ...
  &lt;/code&gt;
&lt;/pre&gt;</code></pre>
<p>A shortcut form can also be used for specifying the language of the code block:</p>
<pre><code>```haskell
qsort [] = []
```</code></pre>
<p>This is equivalent to:</p>
<pre><code>``` {.haskell}
qsort [] = []
```</code></pre>
<p>If the <code>fenced_code_attributes</code> extension is disabled, but input contains class attribute(s) for the code block, the first class attribute will be printed after the opening fence as a bare word.</p>
<p>To prevent all highlighting, use the <code>--no-highlight</code> flag. To set the highlighting style, use <code>--highlight-style</code>. For more information on highlighting, see <a href="#syntax-highlighting">Syntax highlighting</a>, below.</p>
<h2 id="line-blocks">Line blocks</h2>
<h4 id="extension-line_blocks">Extension: <code>line_blocks</code></h4>
<p>A line block is a sequence of lines beginning with a vertical bar (<code>|</code>) followed by a space. The division into lines will be preserved in the output, as will any leading spaces; otherwise, the lines will be formatted as Markdown. This is useful for verse and addresses:</p>
<pre><code>| The limerick packs laughs anatomical
| In space that is quite economical.
|    But the good ones I&#39;ve seen
|    So seldom are clean
| And the clean ones so seldom are comical

| 200 Main St.
| Berkeley, CA 94718</code></pre>
<p>The lines can be hard-wrapped if needed, but the continuation line must begin with a space.</p>
<pre><code>| The Right Honorable Most Venerable and Righteous Samuel L.
  Constable, Jr.
| 200 Main St.
| Berkeley, CA 94718</code></pre>
<p>This syntax is borrowed from <a href="http://docutils.sourceforge.net/docs/ref/rst/introduction.html">reStructuredText</a>.</p>
<h2 id="lists">Lists</h2>
<h3 id="bullet-lists">Bullet lists</h3>
<p>A bullet list is a list of bulleted list items. A bulleted list item begins with a bullet (<code>*</code>, <code>+</code>, or <code>-</code>). Here is a simple example:</p>
<pre><code>* one
* two
* three</code></pre>
<p>This will produce a “compact” list. If you want a “loose” list, in which each item is formatted as a paragraph, put spaces between the items:</p>
<pre><code>* one

* two

* three</code></pre>
<p>The bullets need not be flush with the left margin; they may be indented one, two, or three spaces. The bullet must be followed by whitespace.</p>
<p>List items look best if subsequent lines are flush with the first line (after the bullet):</p>
<pre><code>* here is my first
  list item.
* and my second.</code></pre>
<p>But Markdown also allows a “lazy” format:</p>
<pre><code>* here is my first
list item.
* and my second.</code></pre>
<h3 id="the-four-space-rule">The four-space rule</h3>
<p>A list item may contain multiple paragraphs and other block-level content. However, subsequent paragraphs must be preceded by a blank line and indented four spaces or a tab. The list will look better if the first paragraph is aligned with the rest:</p>
<pre><code>  * First paragraph.

    Continued.

  * Second paragraph. With a code block, which must be indented
    eight spaces:

        { code }</code></pre>
<p>List items may include other lists. In this case the preceding blank line is optional. The nested list must be indented four spaces or one tab:</p>
<pre><code>* fruits
    + apples
        - macintosh
        - red delicious
    + pears
    + peaches
* vegetables
    + broccoli
    + chard</code></pre>
<p>As noted above, Markdown allows you to write list items “lazily,” instead of indenting continuation lines. However, if there are multiple paragraphs or other blocks in a list item, the first line of each must be indented.</p>
<pre><code>+ A lazy, lazy, list
item.

+ Another one; this looks
bad but is legal.

    Second paragraph of second
list item.</code></pre>
<p><strong>Note:</strong> Although the four-space rule for continuation paragraphs comes from the official <a href="http://daringfireball.net/projects/markdown/syntax#list">Markdown syntax guide</a>, the reference implementation, <code>Markdown.pl</code>, does not follow it. So pandoc will give different results than <code>Markdown.pl</code> when authors have indented continuation paragraphs fewer than four spaces.</p>
<p>The <a href="http://daringfireball.net/projects/markdown/syntax#list">Markdown syntax guide</a> is not explicit whether the four-space rule applies to <em>all</em> block-level content in a list item; it only mentions paragraphs and code blocks. But it implies that the rule applies to all block-level content (including nested lists), and pandoc interprets it that way.</p>
<h3 id="ordered-lists">Ordered lists</h3>
<p>Ordered lists work just like bulleted lists, except that the items begin with enumerators rather than bullets.</p>
<p>In standard Markdown, enumerators are decimal numbers followed by a period and a space. The numbers themselves are ignored, so there is no difference between this list:</p>
<pre><code>1.  one
2.  two
3.  three</code></pre>
<p>and this one:</p>
<pre><code>5.  one
7.  two
1.  three</code></pre>
<h4 id="extension-fancy_lists">Extension: <code>fancy_lists</code></h4>
<p>Unlike standard Markdown, pandoc allows ordered list items to be marked with uppercase and lowercase letters and roman numerals, in addition to Arabic numerals. List markers may be enclosed in parentheses or followed by a single right-parentheses or period. They must be separated from the text that follows by at least one space, and, if the list marker is a capital letter with a period, by at least two spaces.<a href="#fn2" class="footnoteRef" id="fnref2"><sup>2</sup></a></p>
<p>The <code>fancy_lists</code> extension also allows ‘<code>#</code>’ to be used as an ordered list marker in place of a numeral:</p>
<pre><code>#. one
#. two</code></pre>
<h4 id="extension-startnum">Extension: <code>startnum</code></h4>
<p>Pandoc also pays attention to the type of list marker used, and to the starting number, and both of these are preserved where possible in the output format. Thus, the following yields a list with numbers followed by a single parenthesis, starting with 9, and a sublist with lowercase roman numerals:</p>
<pre><code> 9)  Ninth
10)  Tenth
11)  Eleventh
       i. subone
      ii. subtwo
     iii. subthree</code></pre>
<p>Pandoc will start a new list each time a different type of list marker is used. So, the following will create three lists:</p>
<pre><code>(2) Two
(5) Three
1.  Four
*   Five</code></pre>
<p>If default list markers are desired, use <code>#.</code>:</p>
<pre><code>#.  one
#.  two
#.  three</code></pre>
<h3 id="definition-lists">Definition lists</h3>
<h4 id="extension-definition_lists">Extension: <code>definition_lists</code></h4>
<p>Pandoc supports definition lists, using the syntax of <a href="https://michelf.ca/projects/php-markdown/extra/">PHP Markdown Extra</a> with some extensions.<a href="#fn3" class="footnoteRef" id="fnref3"><sup>3</sup></a></p>
<pre><code>Term 1

:   Definition 1

Term 2 with *inline markup*

:   Definition 2

        { some code, part of Definition 2 }

    Third paragraph of definition 2.</code></pre>
<p>Each term must fit on one line, which may optionally be followed by a blank line, and must be followed by one or more definitions. A definition begins with a colon or tilde, which may be indented one or two spaces.</p>
<p>A term may have multiple definitions, and each definition may consist of one or more block elements (paragraph, code block, list, etc.), each indented four spaces or one tab stop. The body of the definition (including the first line, aside from the colon or tilde) should be indented four spaces. However, as with other Markdown lists, you can “lazily” omit indentation except at the beginning of a paragraph or other block element:</p>
<pre><code>Term 1

:   Definition
with lazy continuation.

    Second paragraph of the definition.</code></pre>
<p>If you leave space before the definition (as in the example above), the text of the definition will be treated as a paragraph. In some output formats, this will mean greater spacing between term/definition pairs. For a more compact definition list, omit the space before the definition:</p>
<pre><code>Term 1
  ~ Definition 1

Term 2
  ~ Definition 2a
  ~ Definition 2b</code></pre>
<p>Note that space between items in a definition list is required. (A variant that loosens this requirement, but disallows “lazy” hard wrapping, can be activated with <code>compact_definition_lists</code>: see <a href="#non-pandoc-extensions">Non-pandoc extensions</a>, below.)</p>
<h3 id="numbered-example-lists">Numbered example lists</h3>
<h4 id="extension-example_lists">Extension: <code>example_lists</code></h4>
<p>The special list marker <code>@</code> can be used for sequentially numbered examples. The first list item with a <code>@</code> marker will be numbered ‘1’, the next ‘2’, and so on, throughout the document. The numbered examples need not occur in a single list; each new list using <code>@</code> will take up where the last stopped. So, for example:</p>
<pre><code>(@)  My first example will be numbered (1).
(@)  My second example will be numbered (2).

Explanation of examples.

(@)  My third example will be numbered (3).</code></pre>
<p>Numbered examples can be labeled and referred to elsewhere in the document:</p>
<pre><code>(@good)  This is a good example.

As (@good) illustrates, ...</code></pre>
<p>The label can be any string of alphanumeric characters, underscores, or hyphens.</p>
<h3 id="compact-and-loose-lists">Compact and loose lists</h3>
<p>Pandoc behaves differently from <code>Markdown.pl</code> on some “edge cases” involving lists. Consider this source:</p>
<pre><code>+   First
+   Second:
    -   Fee
    -   Fie
    -   Foe

+   Third</code></pre>
<p>Pandoc transforms this into a “compact list” (with no <code>&lt;p&gt;</code> tags around “First”, “Second”, or “Third”), while Markdown puts <code>&lt;p&gt;</code> tags around “Second” and “Third” (but not “First”), because of the blank space around “Third”. Pandoc follows a simple rule: if the text is followed by a blank line, it is treated as a paragraph. Since “Second” is followed by a list, and not a blank line, it isn’t treated as a paragraph. The fact that the list is followed by a blank line is irrelevant. (Note: Pandoc works this way even when the <code>markdown_strict</code> format is specified. This behavior is consistent with the official Markdown syntax description, even though it is different from that of <code>Markdown.pl</code>.)</p>
<h3 id="ending-a-list">Ending a list</h3>
<p>What if you want to put an indented code block after a list?</p>
<pre><code>-   item one
-   item two

    { my code block }</code></pre>
<p>Trouble! Here pandoc (like other Markdown implementations) will treat <code>{ my code block }</code> as the second paragraph of item two, and not as a code block.</p>
<p>To “cut off” the list after item two, you can insert some non-indented content, like an HTML comment, which won’t produce visible output in any format:</p>
<pre><code>-   item one
-   item two

&lt;!-- end of list --&gt;

    { my code block }</code></pre>
<p>You can use the same trick if you want two consecutive lists instead of one big list:</p>
<pre><code>1.  one
2.  two
3.  three

&lt;!-- --&gt;

1.  uno
2.  dos
3.  tres</code></pre>
<h2 id="horizontal-rules">Horizontal rules</h2>
<p>A line containing a row of three or more <code>*</code>, <code>-</code>, or <code>_</code> characters (optionally separated by spaces) produces a horizontal rule:</p>
<pre><code>*  *  *  *

---------------</code></pre>
<h2 id="tables">Tables</h2>
<p>Four kinds of tables may be used. The first three kinds presuppose the use of a fixed-width font, such as Courier. The fourth kind can be used with proportionally spaced fonts, as it does not require lining up columns.</p>
<h4 id="extension-table_captions">Extension: <code>table_captions</code></h4>
<p>A caption may optionally be provided with all 4 kinds of tables (as illustrated in the examples below). A caption is a paragraph beginning with the string <code>Table:</code> (or just <code>:</code>), which will be stripped off. It may appear either before or after the table.</p>
<h4 id="extension-simple_tables">Extension: <code>simple_tables</code></h4>
<p>Simple tables look like this:</p>
<pre><code>  Right     Left     Center     Default
-------     ------ ----------   -------
     12     12        12            12
    123     123       123          123
      1     1          1             1

Table:  Demonstration of simple table syntax.</code></pre>
<p>The headers and table rows must each fit on one line. Column alignments are determined by the position of the header text relative to the dashed line below it:<a href="#fn4" class="footnoteRef" id="fnref4"><sup>4</sup></a></p>
<ul>
<li>If the dashed line is flush with the header text on the right side but extends beyond it on the left, the column is right-aligned.</li>
<li>If the dashed line is flush with the header text on the left side but extends beyond it on the right, the column is left-aligned.</li>
<li>If the dashed line extends beyond the header text on both sides, the column is centered.</li>
<li>If the dashed line is flush with the header text on both sides, the default alignment is used (in most cases, this will be left).</li>
</ul>
<p>The table must end with a blank line, or a line of dashes followed by a blank line.</p>
<p>The column headers may be omitted, provided a dashed line is used to end the table. For example:</p>
<pre><code>-------     ------ ----------   -------
     12     12        12             12
    123     123       123           123
      1     1          1              1
-------     ------ ----------   -------</code></pre>
<p>When headers are omitted, column alignments are determined on the basis of the first line of the table body. So, in the tables above, the columns would be right, left, center, and right aligned, respectively.</p>
<h4 id="extension-multiline_tables">Extension: <code>multiline_tables</code></h4>
<p>Multiline tables allow headers and table rows to span multiple lines of text (but cells that span multiple columns or rows of the table are not supported). Here is an example:</p>
<pre><code>-------------------------------------------------------------
 Centered   Default           Right Left
  Header    Aligned         Aligned Aligned
----------- ------- --------------- -------------------------
   First    row                12.0 Example of a row that
                                    spans multiple lines.

  Second    row                 5.0 Here&#39;s another one. Note
                                    the blank line between
                                    rows.
-------------------------------------------------------------

Table: Here&#39;s the caption. It, too, may span
multiple lines.</code></pre>
<p>These work like simple tables, but with the following differences:</p>
<ul>
<li>They must begin with a row of dashes, before the header text (unless the headers are omitted).</li>
<li>They must end with a row of dashes, then a blank line.</li>
<li>The rows must be separated by blank lines.</li>
</ul>
<p>In multiline tables, the table parser pays attention to the widths of the columns, and the writers try to reproduce these relative widths in the output. So, if you find that one of the columns is too narrow in the output, try widening it in the Markdown source.</p>
<p>Headers may be omitted in multiline tables as well as simple tables:</p>
<pre><code>----------- ------- --------------- -------------------------
   First    row                12.0 Example of a row that
                                    spans multiple lines.

  Second    row                 5.0 Here&#39;s another one. Note
                                    the blank line between
                                    rows.
----------- ------- --------------- -------------------------

: Here&#39;s a multiline table without headers.</code></pre>
<p>It is possible for a multiline table to have just one row, but the row should be followed by a blank line (and then the row of dashes that ends the table), or the table may be interpreted as a simple table.</p>
<h4 id="extension-grid_tables">Extension: <code>grid_tables</code></h4>
<p>Grid tables look like this:</p>
<pre><code>: Sample grid table.

+---------------+---------------+--------------------+
| Fruit         | Price         | Advantages         |
+===============+===============+====================+
| Bananas       | $1.34         | - built-in wrapper |
|               |               | - bright color     |
+---------------+---------------+--------------------+
| Oranges       | $2.10         | - cures scurvy     |
|               |               | - tasty            |
+---------------+---------------+--------------------+</code></pre>
<p>The row of <code>=</code>s separates the header from the table body, and can be omitted for a headerless table. The cells of grid tables may contain arbitrary block elements (multiple paragraphs, code blocks, lists, etc.). Cells that span multiple columns or rows are not supported. Grid tables can be created easily using <a href="http://table.sourceforge.net/">Emacs table mode</a>.</p>
<p>Alignments can be specified as with pipe tables, by putting colons at the boundaries of the separator line after the header:</p>
<pre><code>+---------------+---------------+--------------------+
| Right         | Left          | Centered           |
+==============:+:==============+:==================:+
| Bananas       | $1.34         | built-in wrapper   |
+---------------+---------------+--------------------+</code></pre>
<p>For headerless tables, the colons go on the top line instead:</p>
<pre><code>+--------------:+:--------------+:------------------:+
| Right         | Left          | Centered           |
+---------------+---------------+--------------------+</code></pre>
<h4 id="extension-pipe_tables">Extension: <code>pipe_tables</code></h4>
<p>Pipe tables look like this:</p>
<pre><code>| Right | Left | Default | Center |
|------:|:-----|---------|:------:|
|   12  |  12  |    12   |    12  |
|  123  |  123 |   123   |   123  |
|    1  |    1 |     1   |     1  |

  : Demonstration of pipe table syntax.</code></pre>
<p>The syntax is identical to <a href="https://michelf.ca/projects/php-markdown/extra/#table">PHP Markdown Extra tables</a>. The beginning and ending pipe characters are optional, but pipes are required between all columns. The colons indicate column alignment as shown. The header cannot be omitted. To simulate a headerless table, include a header with blank cells.</p>
<p>Since the pipes indicate column boundaries, columns need not be vertically aligned, as they are in the above example. So, this is a perfectly legal (though ugly) pipe table:</p>
<pre><code>fruit| price
-----|-----:
apple|2.05
pear|1.37
orange|3.09</code></pre>
<p>The cells of pipe tables cannot contain block elements like paragraphs and lists, and cannot span multiple lines. If a pipe table contains a row whose printable content is wider than the column width (see <code>--columns</code>), then the cell contents will wrap, with the relative cell widths determined by the widths of the separator lines.</p>
<p>Note: pandoc also recognizes pipe tables of the following form, as can be produced by Emacs’ orgtbl-mode:</p>
<pre><code>| One | Two   |
|-----+-------|
| my  | table |
| is  | nice  |</code></pre>
<p>The difference is that <code>+</code> is used instead of <code>|</code>. Other orgtbl features are not supported. In particular, to get non-default column alignment, you’ll need to add colons as above.</p>
<h2 id="metadata-blocks">Metadata blocks</h2>
<h4 id="extension-pandoc_title_block">Extension: <code>pandoc_title_block</code></h4>
<p>If the file begins with a title block</p>
<pre><code>% title
% author(s) (separated by semicolons)
% date</code></pre>
<p>it will be parsed as bibliographic information, not regular text. (It will be used, for example, in the title of standalone LaTeX or HTML output.) The block may contain just a title, a title and an author, or all three elements. If you want to include an author but no title, or a title and a date but no author, you need a blank line:</p>
<pre><code>%
% Author

% My title
%
% June 15, 2006</code></pre>
<p>The title may occupy multiple lines, but continuation lines must begin with leading space, thus:</p>
<pre><code>% My title
  on multiple lines</code></pre>
<p>If a document has multiple authors, the authors may be put on separate lines with leading space, or separated by semicolons, or both. So, all of the following are equivalent:</p>
<pre><code>% Author One
  Author Two

% Author One; Author Two

% Author One;
  Author Two</code></pre>
<p>The date must fit on one line.</p>
<p>All three metadata fields may contain standard inline formatting (italics, links, footnotes, etc.).</p>
<p>Title blocks will always be parsed, but they will affect the output only when the <code>--standalone</code> (<code>-s</code>) option is chosen. In HTML output, titles will appear twice: once in the document head – this is the title that will appear at the top of the window in a browser – and once at the beginning of the document body. The title in the document head can have an optional prefix attached (<code>--title-prefix</code> or <code>-T</code> option). The title in the body appears as an H1 element with class “title”, so it can be suppressed or reformatted with CSS. If a title prefix is specified with <code>-T</code> and no title block appears in the document, the title prefix will be used by itself as the HTML title.</p>
<p>The man page writer extracts a title, man page section number, and other header and footer information from the title line. The title is assumed to be the first word on the title line, which may optionally end with a (single-digit) section number in parentheses. (There should be no space between the title and the parentheses.) Anything after this is assumed to be additional footer and header text. A single pipe character (<code>|</code>) should be used to separate the footer text from the header text. Thus,</p>
<pre><code>% PANDOC(1)</code></pre>
<p>will yield a man page with the title <code>PANDOC</code> and section 1.</p>
<pre><code>% PANDOC(1) Pandoc User Manuals</code></pre>
<p>will also have “Pandoc User Manuals” in the footer.</p>
<pre><code>% PANDOC(1) Pandoc User Manuals | Version 4.0</code></pre>
<p>will also have “Version 4.0” in the header.</p>
<h4 id="extension-yaml_metadata_block">Extension: <code>yaml_metadata_block</code></h4>
<p>A YAML metadata block is a valid YAML object, delimited by a line of three hyphens (<code>---</code>) at the top and a line of three hyphens (<code>---</code>) or three dots (<code>...</code>) at the bottom. A YAML metadata block may occur anywhere in the document, but if it is not at the beginning, it must be preceded by a blank line. (Note that, because of the way pandoc concatenates input files when several are provided, you may also keep the metadata in a separate YAML file and pass it to pandoc as an argument, along with your Markdown files:</p>
<pre><code>pandoc chap1.md chap2.md chap3.md metadata.yaml -s -o book.html</code></pre>
<p>Just be sure that the YAML file begins with <code>---</code> and ends with <code>---</code> or <code>...</code>.)</p>
<p>Metadata will be taken from the fields of the YAML object and added to any existing document metadata. Metadata can contain lists and objects (nested arbitrarily), but all string scalars will be interpreted as Markdown. Fields with names ending in an underscore will be ignored by pandoc. (They may be given a role by external processors.)</p>
<p>A document may contain multiple metadata blocks. The metadata fields will be combined through a <em>left-biased union</em>: if two metadata blocks attempt to set the same field, the value from the first block will be taken.</p>
<p>When pandoc is used with <code>-t markdown</code> to create a Markdown document, a YAML metadata block will be produced only if the <code>-s/--standalone</code> option is used. All of the metadata will appear in a single block at the beginning of the document.</p>
<p>Note that YAML escaping rules must be followed. Thus, for example, if a title contains a colon, it must be quoted. The pipe character (<code>|</code>) can be used to begin an indented block that will be interpreted literally, without need for escaping. This form is necessary when the field contains blank lines:</p>
<pre><code>---
title:  &#39;This is the title: it contains a colon&#39;
author:
- Author One
- Author Two
tags: [nothing, nothingness]
abstract: |
  This is the abstract.

  It consists of two paragraphs.
...</code></pre>
<p>Template variables will be set automatically from the metadata. Thus, for example, in writing HTML, the variable <code>abstract</code> will be set to the HTML equivalent of the Markdown in the <code>abstract</code> field:</p>
<pre><code>&lt;p&gt;This is the abstract.&lt;/p&gt;
&lt;p&gt;It consists of two paragraphs.&lt;/p&gt;</code></pre>
<p>Variables can contain arbitrary YAML structures, but the template must match this structure. The <code>author</code> variable in the default templates expects a simple list or string, but can be changed to support more complicated structures. The following combination, for example, would add an affiliation to the author if one is given:</p>
<pre><code>---
title: The document title
author:
- name: Author One
  affiliation: University of Somewhere
- name: Author Two
  affiliation: University of Nowhere
...</code></pre>
<p>To use the structured authors in the example above, you would need a custom template:</p>
<pre><code>$for(author)$
$if(author.name)$
$author.name$$if(author.affiliation)$ ($author.affiliation$)$endif$
$else$
$author$
$endif$
$endfor$</code></pre>
<h2 id="backslash-escapes">Backslash escapes</h2>
<h4 id="extension-all_symbols_escapable">Extension: <code>all_symbols_escapable</code></h4>
<p>Except inside a code block or inline code, any punctuation or space character preceded by a backslash will be treated literally, even if it would normally indicate formatting. Thus, for example, if one writes</p>
<pre><code>*\*hello\**</code></pre>
<p>one will get</p>
<pre><code>&lt;em&gt;*hello*&lt;/em&gt;</code></pre>
<p>instead of</p>
<pre><code>&lt;strong&gt;hello&lt;/strong&gt;</code></pre>
<p>This rule is easier to remember than standard Markdown’s rule, which allows only the following characters to be backslash-escaped:</p>
<pre><code>\`*_{}[]()&gt;#+-.!</code></pre>
<p>(However, if the <code>markdown_strict</code> format is used, the standard Markdown rule will be used.)</p>
<p>A backslash-escaped space is parsed as a nonbreaking space. It will appear in TeX output as <code>~</code> and in HTML and XML as <code>\&amp;#160;</code> or <code>\&amp;nbsp;</code>.</p>
<p>A backslash-escaped newline (i.e. a backslash occurring at the end of a line) is parsed as a hard line break. It will appear in TeX output as <code>\\</code> and in HTML as <code>&lt;br /&gt;</code>. This is a nice alternative to Markdown’s “invisible” way of indicating hard line breaks using two trailing spaces on a line.</p>
<p>Backslash escapes do not work in verbatim contexts.</p>
<h2 id="smart-punctuation">Smart punctuation</h2>
<h4 id="extension">Extension</h4>
<p>If the <code>--smart</code> option is specified, pandoc will produce typographically correct output, converting straight quotes to curly quotes, <code>---</code> to em-dashes, <code>--</code> to en-dashes, and <code>...</code> to ellipses. Nonbreaking spaces are inserted after certain abbreviations, such as “Mr.”</p>
<p>Note: if your LaTeX template or any included header file call for the <a href="https://ctan.org/pkg/csquotes"><code>csquotes</code></a> package, pandoc will detect this automatically and use <code>\enquote{...}</code> for quoted text.</p>
<h2 id="inline-formatting">Inline formatting</h2>
<h3 id="emphasis">Emphasis</h3>
<p>To <em>emphasize</em> some text, surround it with <code>*</code>s or <code>_</code>, like this:</p>
<pre><code>This text is _emphasized with underscores_, and this
is *emphasized with asterisks*.</code></pre>
<p>Double <code>*</code> or <code>_</code> produces <strong>strong emphasis</strong>:</p>
<pre><code>This is **strong emphasis** and __with underscores__.</code></pre>
<p>A <code>*</code> or <code>_</code> character surrounded by spaces, or backslash-escaped, will not trigger emphasis:</p>
<pre><code>This is * not emphasized *, and \*neither is this\*.</code></pre>
<h4 id="extension-intraword_underscores">Extension: <code>intraword_underscores</code></h4>
<p>Because <code>_</code> is sometimes used inside words and identifiers, pandoc does not interpret a <code>_</code> surrounded by alphanumeric characters as an emphasis marker. If you want to emphasize just part of a word, use <code>*</code>:</p>
<pre><code>feas*ible*, not feas*able*.</code></pre>
<h3 id="strikeout">Strikeout</h3>
<h4 id="extension-strikeout">Extension: <code>strikeout</code></h4>
<p>To strikeout a section of text with a horizontal line, begin and end it with <code>~~</code>. Thus, for example,</p>
<pre><code>This ~~is deleted text.~~</code></pre>
<h3 id="superscripts-and-subscripts">Superscripts and subscripts</h3>
<h4 id="extension-superscript-subscript">Extension: <code>superscript</code>, <code>subscript</code></h4>
<p>Superscripts may be written by surrounding the superscripted text by <code>^</code> characters; subscripts may be written by surrounding the subscripted text by <code>~</code> characters. Thus, for example,</p>
<pre><code>H~2~O is a liquid.  2^10^ is 1024.</code></pre>
<p>If the superscripted or subscripted text contains spaces, these spaces must be escaped with backslashes. (This is to prevent accidental superscripting and subscripting through the ordinary use of <code>~</code> and <code>^</code>.) Thus, if you want the letter P with ‘a cat’ in subscripts, use <code>P~a\ cat~</code>, not <code>P~a cat~</code>.</p>
<h3 id="verbatim">Verbatim</h3>
<p>To make a short span of text verbatim, put it inside backticks:</p>
<pre><code>What is the difference between `&gt;&gt;=` and `&gt;&gt;`?</code></pre>
<p>If the verbatim text includes a backtick, use double backticks:</p>
<pre><code>Here is a literal backtick `` ` ``.</code></pre>
<p>(The spaces after the opening backticks and before the closing backticks will be ignored.)</p>
<p>The general rule is that a verbatim span starts with a string of consecutive backticks (optionally followed by a space) and ends with a string of the same number of backticks (optionally preceded by a space).</p>
<p>Note that backslash-escapes (and other Markdown constructs) do not work in verbatim contexts:</p>
<pre><code>This is a backslash followed by an asterisk: `\*`.</code></pre>
<h4 id="extension-inline_code_attributes">Extension: <code>inline_code_attributes</code></h4>
<p>Attributes can be attached to verbatim text, just as with <a href="#fenced-code-blocks">fenced code blocks</a>:</p>
<pre><code>`&lt;$&gt;`{.haskell}</code></pre>
<h3 id="small-caps">Small caps</h3>
<p>To write small caps, you can use an HTML span tag:</p>
<pre><code>&lt;span style=&quot;font-variant:small-caps;&quot;&gt;Small caps&lt;/span&gt;</code></pre>
<p>(The semicolon is optional and there may be space after the colon.) This will work in all output formats that support small caps.</p>
<p>Alternatively, you can also use the new <code>bracketed_spans</code> syntax:</p>
<pre><code>[Small caps]{style=&quot;font-variant:small-caps;&quot;}</code></pre>
<h2 id="math">Math</h2>
<h4 id="extension-tex_math_dollars">Extension: <code>tex_math_dollars</code></h4>
<p>Anything between two <code>$</code> characters will be treated as TeX math. The opening <code>$</code> must have a non-space character immediately to its right, while the closing <code>$</code> must have a non-space character immediately to its left, and must not be followed immediately by a digit. Thus, <code>$20,000 and $30,000</code> won’t parse as math. If for some reason you need to enclose text in literal <code>$</code> characters, backslash-escape them and they won’t be treated as math delimiters.</p>
<p>TeX math will be printed in all output formats. How it is rendered depends on the output format:</p>
<dl>
<dt>Markdown, LaTeX, Emacs Org mode, ConTeXt, ZimWiki</dt>
<dd>It will appear verbatim between <code>$</code> characters.
</dd>
<dt>reStructuredText</dt>
<dd>It will be rendered using an <a href="http://docutils.sourceforge.net/docs/ref/rst/roles.html#math">interpreted text role <code>:math:</code></a>.
</dd>
<dt>AsciiDoc</dt>
<dd>It will be rendered as <code>latexmath:[...]</code>.
</dd>
<dt>Texinfo</dt>
<dd>It will be rendered inside a <code>@math</code> command.
</dd>
<dt>groff man</dt>
<dd>It will be rendered verbatim without <code>$</code>’s.
</dd>
<dt>MediaWiki, DokuWiki</dt>
<dd>It will be rendered inside <code>&lt;math&gt;</code> tags.
</dd>
<dt>Textile</dt>
<dd>It will be rendered inside <code>&lt;span class=&quot;math&quot;&gt;</code> tags.
</dd>
<dt>RTF, OpenDocument, ODT</dt>
<dd>It will be rendered, if possible, using Unicode characters, and will otherwise appear verbatim.
</dd>
<dt>DocBook</dt>
<dd>If the <code>--mathml</code> flag is used, it will be rendered using MathML in an <code>inlineequation</code> or <code>informalequation</code> tag. Otherwise it will be rendered, if possible, using Unicode characters.
</dd>
<dt>Docx</dt>
<dd>It will be rendered using OMML math markup.
</dd>
<dt>FictionBook2</dt>
<dd>If the <code>--webtex</code> option is used, formulas are rendered as images using CodeCogs or other compatible web service, downloaded and embedded in the e-book. Otherwise, they will appear verbatim.
</dd>
<dt>HTML, Slidy, DZSlides, S5, EPUB</dt>
<dd><p>The way math is rendered in HTML will depend on the command-line options selected:</p>
<ol style="list-style-type: decimal">
<li><p>The default is to render TeX math as far as possible using Unicode characters, as with RTF, DocBook, and OpenDocument output. Formulas are put inside a <code>span</code> with <code>class=&quot;math&quot;</code>, so that they may be styled differently from the surrounding text if needed.</p></li>
<li><p>If the <code>--latexmathml</code> option is used, TeX math will be displayed between <code>$</code> or <code>$$</code> characters and put in <code>&lt;span&gt;</code> tags with class <code>LaTeX</code>. The <a href="http://math.etsu.edu/LaTeXMathML/">LaTeXMathML</a> script will be used to render it as formulas. (This trick does not work in all browsers, but it works in Firefox. In browsers that do not support LaTeXMathML, TeX math will appear verbatim between <code>$</code> characters.)</p></li>
<li><p>If the <code>--jsmath</code> option is used, TeX math will be put inside <code>&lt;span&gt;</code> tags (for inline math) or <code>&lt;div&gt;</code> tags (for display math) with class <code>math</code>. The <a href="http://www.math.union.edu/~dpvc/jsmath/">jsMath</a> script will be used to render it.</p></li>
<li><p>If the <code>--mimetex</code> option is used, the <a href="http://www.forkosh.com/mimetex.html">mimeTeX</a> CGI script will be called to generate images for each TeX formula. This should work in all browsers. The <code>--mimetex</code> option takes an optional URL as argument. If no URL is specified, it will be assumed that the mimeTeX CGI script is at <code>/cgi-bin/mimetex.cgi</code>.</p></li>
<li><p>If the <code>--gladtex</code> option is used, TeX formulas will be enclosed in <code>&lt;eq&gt;</code> tags in the HTML output. The resulting <code>htex</code> file may then be processed by <a href="http://ans.hsh.no/home/mgg/gladtex/">gladTeX</a>, which will produce image files for each formula and an HTML file with links to these images. So, the procedure is:</p>
<pre><code>pandoc -s --gladtex myfile.txt -o myfile.htex
gladtex -d myfile-images myfile.htex
# produces myfile.html and images in myfile-images</code></pre></li>
<li><p>If the <code>--webtex</code> option is used, TeX formulas will be converted to <code>&lt;img&gt;</code> tags that link to an external script that converts formulas to images. The formula will be URL-encoded and concatenated with the URL provided. If no URL is specified, the CodeCogs will be used (<code>https://latex.codecogs.com/png.latex?</code>).</p></li>
<li><p>If the <code>--mathjax</code> option is used, TeX math will be displayed between <code>\(...\)</code> (for inline math) or <code>\[...\]</code> (for display math) and put in <code>&lt;span&gt;</code> tags with class <code>math</code>. The <a href="https://www.mathjax.org">MathJax</a> script will be used to render it as formulas.</p></li>
</ol>
</dd>
</dl>
<h2 id="raw-html">Raw HTML</h2>
<h4 id="extension-raw_html">Extension: <code>raw_html</code></h4>
<p>Markdown allows you to insert raw HTML (or DocBook) anywhere in a document (except verbatim contexts, where <code>&lt;</code>, <code>&gt;</code>, and <code>&amp;</code> are interpreted literally). (Technically this is not an extension, since standard Markdown allows it, but it has been made an extension so that it can be disabled if desired.)</p>
<p>The raw HTML is passed through unchanged in HTML, S5, Slidy, Slideous, DZSlides, EPUB, Markdown, Emacs Org mode, and Textile output, and suppressed in other formats.</p>
<h4 id="extension-markdown_in_html_blocks">Extension: <code>markdown_in_html_blocks</code></h4>
<p>Standard Markdown allows you to include HTML “blocks”: blocks of HTML between balanced tags that are separated from the surrounding text with blank lines, and start and end at the left margin. Within these blocks, everything is interpreted as HTML, not Markdown; so (for example), <code>*</code> does not signify emphasis.</p>
<p>Pandoc behaves this way when the <code>markdown_strict</code> format is used; but by default, pandoc interprets material between HTML block tags as Markdown. Thus, for example, pandoc will turn</p>
<pre><code>&lt;table&gt;
&lt;tr&gt;
&lt;td&gt;*one*&lt;/td&gt;
&lt;td&gt;[a link](http://google.com)&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;</code></pre>
<p>into</p>
<pre><code>&lt;table&gt;
&lt;tr&gt;
&lt;td&gt;&lt;em&gt;one&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;http://google.com&quot;&gt;a link&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;</code></pre>
<p>whereas <code>Markdown.pl</code> will preserve it as is.</p>
<p>There is one exception to this rule: text between <code>&lt;script&gt;</code> and <code>&lt;style&gt;</code> tags is not interpreted as Markdown.</p>
<p>This departure from standard Markdown should make it easier to mix Markdown with HTML block elements. For example, one can surround a block of Markdown text with <code>&lt;div&gt;</code> tags without preventing it from being interpreted as Markdown.</p>
<h4 id="extension-native_divs">Extension: <code>native_divs</code></h4>
<p>Use native pandoc <code>Div</code> blocks for content inside <code>&lt;div&gt;</code> tags. For the most part this should give the same output as <code>markdown_in_html_blocks</code>, but it makes it easier to write pandoc filters to manipulate groups of blocks.</p>
<h4 id="extension-native_spans">Extension: <code>native_spans</code></h4>
<p>Use native pandoc <code>Span</code> blocks for content inside <code>&lt;span&gt;</code> tags. For the most part this should give the same output as <code>raw_html</code>, but it makes it easier to write pandoc filters to manipulate groups of inlines.</p>
<h2 id="raw-tex">Raw TeX</h2>
<h4 id="extension-raw_tex">Extension: <code>raw_tex</code></h4>
<p>In addition to raw HTML, pandoc allows raw LaTeX, TeX, and ConTeXt to be included in a document. Inline TeX commands will be preserved and passed unchanged to the LaTeX and ConTeXt writers. Thus, for example, you can use LaTeX to include BibTeX citations:</p>
<pre><code>This result was proved in \cite{jones.1967}.</code></pre>
<p>Note that in LaTeX environments, like</p>
<pre><code>\begin{tabular}{|l|l|}\hline
Age &amp; Frequency \\ \hline
18--25  &amp; 15 \\
26--35  &amp; 33 \\
36--45  &amp; 22 \\ \hline
\end{tabular}</code></pre>
<p>the material between the begin and end tags will be interpreted as raw LaTeX, not as Markdown.</p>
<p>Inline LaTeX is ignored in output formats other than Markdown, LaTeX, Emacs Org mode, and ConTeXt.</p>
<h2 id="latex-macros">LaTeX macros</h2>
<h4 id="extension-latex_macros">Extension: <code>latex_macros</code></h4>
<p>For output formats other than LaTeX, pandoc will parse LaTeX <code>\newcommand</code> and <code>\renewcommand</code> definitions and apply the resulting macros to all LaTeX math. So, for example, the following will work in all output formats, not just LaTeX:</p>
<pre><code>\newcommand{\tuple}[1]{\langle #1 \rangle}

$\tuple{a, b, c}$</code></pre>
<p>In LaTeX output, the <code>\newcommand</code> definition will simply be passed unchanged to the output.</p>
<h2 id="links">Links</h2>
<p>Markdown allows links to be specified in several ways.</p>
<h3 id="automatic-links">Automatic links</h3>
<p>If you enclose a URL or email address in pointy brackets, it will become a link:</p>
<pre><code>&lt;http://google.com&gt;
&lt;sam@green.eggs.ham&gt;</code></pre>
<h3 id="inline-links">Inline links</h3>
<p>An inline link consists of the link text in square brackets, followed by the URL in parentheses. (Optionally, the URL can be followed by a link title, in quotes.)</p>
<pre><code>This is an [inline link](/url), and here&#39;s [one with
a title](http://fsf.org &quot;click here for a good time!&quot;).</code></pre>
<p>There can be no space between the bracketed part and the parenthesized part. The link text can contain formatting (such as emphasis), but the title cannot.</p>
<p>Email addresses in inline links are not autodetected, so they have to be prefixed with <code>mailto</code>:</p>
<pre><code>[Write me!](mailto:sam@green.eggs.ham)</code></pre>
<h3 id="reference-links">Reference links</h3>
<p>An <em>explicit</em> reference link has two parts, the link itself and the link definition, which may occur elsewhere in the document (either before or after the link).</p>
<p>The link consists of link text in square brackets, followed by a label in square brackets. (There can be space between the two.) The link definition consists of the bracketed label, followed by a colon and a space, followed by the URL, and optionally (after a space) a link title either in quotes or in parentheses. The label must not be parseable as a citation (assuming the <code>citations</code> extension is enabled): citations take precedence over link labels.</p>
<p>Here are some examples:</p>
<pre><code>[my label 1]: /foo/bar.html  &quot;My title, optional&quot;
[my label 2]: /foo
[my label 3]: http://fsf.org (The free software foundation)
[my label 4]: /bar#special  &#39;A title in single quotes&#39;</code></pre>
<p>The URL may optionally be surrounded by angle brackets:</p>
<pre><code>[my label 5]: &lt;http://foo.bar.baz&gt;</code></pre>
<p>The title may go on the next line:</p>
<pre><code>[my label 3]: http://fsf.org
  &quot;The free software foundation&quot;</code></pre>
<p>Note that link labels are not case sensitive. So, this will work:</p>
<pre><code>Here is [my link][FOO]

[Foo]: /bar/baz</code></pre>
<p>In an <em>implicit</em> reference link, the second pair of brackets is empty:</p>
<pre><code>See [my website][].

[my website]: http://foo.bar.baz</code></pre>
<p>Note: In <code>Markdown.pl</code> and most other Markdown implementations, reference link definitions cannot occur in nested constructions such as list items or block quotes. Pandoc lifts this arbitrary seeming restriction. So the following is fine in pandoc, though not in most other implementations:</p>
<pre><code>&gt; My block [quote].
&gt;
&gt; [quote]: /foo</code></pre>
<h4 id="extension-shortcut_reference_links">Extension: <code>shortcut_reference_links</code></h4>
<p>In a <em>shortcut</em> reference link, the second pair of brackets may be omitted entirely:</p>
<pre><code>See [my website].

[my website]: http://foo.bar.baz</code></pre>
<h3 id="internal-links">Internal links</h3>
<p>To link to another section of the same document, use the automatically generated identifier (see <a href="#header-identifiers">Header identifiers</a>). For example:</p>
<pre><code>See the [Introduction](#introduction).</code></pre>
<p>or</p>
<pre><code>See the [Introduction].

[Introduction]: #introduction</code></pre>
<p>Internal links are currently supported for HTML formats (including HTML slide shows and EPUB), LaTeX, and ConTeXt.</p>
<h2 id="images">Images</h2>
<p>A link immediately preceded by a <code>!</code> will be treated as an image. The link text will be used as the image’s alt text:</p>
<pre><code>![la lune](lalune.jpg &quot;Voyage to the moon&quot;)

![movie reel]

[movie reel]: movie.gif</code></pre>
<h4 id="extension-implicit_figures">Extension: <code>implicit_figures</code></h4>
<p>An image occurring by itself in a paragraph will be rendered as a figure with a caption.<a href="#fn5" class="footnoteRef" id="fnref5"><sup>5</sup></a> (In LaTeX, a figure environment will be used; in HTML, the image will be placed in a <code>div</code> with class <code>figure</code>, together with a caption in a <code>p</code> with class <code>caption</code>.) The image’s alt text will be used as the caption.</p>
<pre><code>![This is the caption](/url/of/image.png)</code></pre>
<p>If you just want a regular inline image, just make sure it is not the only thing in the paragraph. One way to do this is to insert a nonbreaking space after the image:</p>
<pre><code>![This image won&#39;t be a figure](/url/of/image.png)\ </code></pre>
<h4 id="extension-link_attributes">Extension: <code>link_attributes</code></h4>
<p>Attributes can be set on links and images:</p>
<pre><code>An inline ![image](foo.jpg){#id .class width=30 height=20px}
and a reference ![image][ref] with attributes.

[ref]: foo.jpg &quot;optional title&quot; {#id .class key=val key2=&quot;val 2&quot;}</code></pre>
<p>(This syntax is compatible with <a href="https://michelf.ca/projects/php-markdown/extra/">PHP Markdown Extra</a> when only <code>#id</code> and <code>.class</code> are used.)</p>
<p>For HTML and EPUB, all attributes except <code>width</code> and <code>height</code> (but including <code>srcset</code> and <code>sizes</code>) are passed through as is. The other writers ignore attributes that are not supported by their output format.</p>
<p>The <code>width</code> and <code>height</code> attributes on images are treated specially. When used without a unit, the unit is assumed to be pixels. However, any of the following unit identifiers can be used: <code>px</code>, <code>cm</code>, <code>mm</code>, <code>in</code>, <code>inch</code> and <code>%</code>. There must not be any spaces between the number and the unit. For example:</p>
<pre><code>![](file.jpg){ width=50% }</code></pre>
<ul>
<li>Dimensions are converted to inches for output in page-based formats like LaTeX. Dimensions are converted to pixels for output in HTML-like formats. Use the <code>--dpi</code> option to specify the number of pixels per inch. The default is 96dpi.</li>
<li>The <code>%</code> unit is generally relative to some available space. For example the above example will render to <code>&lt;img href=&quot;file.jpg&quot; style=&quot;width: 50%;&quot; /&gt;</code> (HTML), <code>\includegraphics[width=0.5\textwidth]{file.jpg}</code> (LaTeX), or <code>\externalfigure[file.jpg][width=0.5\textwidth]</code> (ConTeXt).</li>
<li>Some output formats have a notion of a class (<a href="http://wiki.contextgarden.net/Using_Graphics#Multiple_Image_Settings">ConTeXt</a>) or a unique identifier (LaTeX <code>\caption</code>), or both (HTML).</li>
<li>When no <code>width</code> or <code>height</code> attributes are specified, the fallback is to look at the image resolution and the dpi metadata embedded in the image file.</li>
</ul>
<h2 id="spans">Spans</h2>
<h4 id="extension-bracketed_spans">Extension: <code>bracketed_spans</code></h4>
<p>A bracketed sequence of inlines, as one would use to begin a link, will be treated as a span with attributes if it is followed immediately by attributes:</p>
<pre><code>[This is *some text*]{.class key=&quot;val&quot;}</code></pre>
<h2 id="footnotes">Footnotes</h2>
<h4 id="extension-footnotes">Extension: <code>footnotes</code></h4>
<p>Pandoc’s Markdown allows footnotes, using the following syntax:</p>
<pre><code>Here is a footnote reference,[^1] and another.[^longnote]

[^1]: Here is the footnote.

[^longnote]: Here&#39;s one with multiple blocks.

    Subsequent paragraphs are indented to show that they
belong to the previous footnote.

        { some.code }

    The whole paragraph can be indented, or just the first
    line.  In this way, multi-paragraph footnotes work like
    multi-paragraph list items.

This paragraph won&#39;t be part of the note, because it
isn&#39;t indented.</code></pre>
<p>The identifiers in footnote references may not contain spaces, tabs, or newlines. These identifiers are used only to correlate the footnote reference with the note itself; in the output, footnotes will be numbered sequentially.</p>
<p>The footnotes themselves need not be placed at the end of the document. They may appear anywhere except inside other block elements (lists, block quotes, tables, etc.). Each footnote should be separated from surrounding content (including other footnotes) by blank lines.</p>
<h4 id="extension-inline_notes">Extension: <code>inline_notes</code></h4>
<p>Inline footnotes are also allowed (though, unlike regular notes, they cannot contain multiple paragraphs). The syntax is as follows:</p>
<pre><code>Here is an inline note.^[Inlines notes are easier to write, since
you don&#39;t have to pick an identifier and move down to type the
note.]</code></pre>
<p>Inline and regular footnotes may be mixed freely.</p>
<h2 id="citations">Citations</h2>
<h4 id="extension-citations">Extension: <code>citations</code></h4>
<p>Using an external filter, <code>pandoc-citeproc</code>, pandoc can automatically generate citations and a bibliography in a number of styles. Basic usage is</p>
<pre><code>pandoc --filter pandoc-citeproc myinput.txt</code></pre>
<p>In order to use this feature, you will need to specify a bibliography file using the <code>bibliography</code> metadata field in a YAML metadata section, or <code>--bibliography</code> command line argument. You can supply multiple <code>--bibliography</code> arguments or set <code>bibliography</code> metadata field to YAML array, if you want to use multiple bibliography files. The bibliography may have any of these formats:</p>
<table>
<thead>
<tr class="header">
<th align="left">Format</th>
<th>File extension</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="left">BibLaTeX</td>
<td>.bib</td>
</tr>
<tr class="even">
<td align="left">BibTeX</td>
<td>.bibtex</td>
</tr>
<tr class="odd">
<td align="left">Copac</td>
<td>.copac</td>
</tr>
<tr class="even">
<td align="left">CSL JSON</td>
<td>.json</td>
</tr>
<tr class="odd">
<td align="left">CSL YAML</td>
<td>.yaml</td>
</tr>
<tr class="even">
<td align="left">EndNote</td>
<td>.enl</td>
</tr>
<tr class="odd">
<td align="left">EndNote XML</td>
<td>.xml</td>
</tr>
<tr class="even">
<td align="left">ISI</td>
<td>.wos</td>
</tr>
<tr class="odd">
<td align="left">MEDLINE</td>
<td>.medline</td>
</tr>
<tr class="even">
<td align="left">MODS</td>
<td>.mods</td>
</tr>
<tr class="odd">
<td align="left">RIS</td>
<td>.ris</td>
</tr>
</tbody>
</table>
<p>Note that <code>.bib</code> can be used with both BibTeX and BibLaTeX files; use <code>.bibtex</code> to force BibTeX.</p>
<p>Note that <code>pandoc-citeproc --bib2json</code> and <code>pandoc-citeproc --bib2yaml</code> can produce <code>.json</code> and <code>.yaml</code> files from any of the supported formats.</p>
<p>In-field markup: In BibTeX and BibLaTeX databases, pandoc-citeproc parses a subset of LaTeX markup; in CSL YAML databases, pandoc Markdown; and in CSL JSON databases, an <a href="http://docs.citationstyles.org/en/1.0/release-notes.html#rich-text-markup-within-fields">HTML-like markup</a>:</p>
<dl>
<dt><code>&lt;i&gt;...&lt;/i&gt;</code></dt>
<dd>italics
</dd>
<dt><code>&lt;b&gt;...&lt;/b&gt;</code></dt>
<dd>bold
</dd>
<dt><code>&lt;span style=&quot;font-variant:small-caps;&quot;&gt;...&lt;/span&gt;</code> or <code>&lt;sc&gt;...&lt;/sc&gt;</code></dt>
<dd>small capitals
</dd>
<dt><code>&lt;sub&gt;...&lt;/sub&gt;</code></dt>
<dd>subscript
</dd>
<dt><code>&lt;sup&gt;...&lt;/sup&gt;</code></dt>
<dd>superscript
</dd>
<dt><code>&lt;span class=&quot;nocase&quot;&gt;...&lt;/span&gt;</code></dt>
<dd>prevent a phrase from being capitalized as title case
</dd>
</dl>
<p><code>pandoc-citeproc -j</code> and <code>-y</code> interconvert the CSL JSON and CSL YAML formats as far as possible.</p>
<p>As an alternative to specifying a bibliography file using <code>--bibliography</code> or the YAML metadata field <code>bibliography</code>, you can include the citation data directly in the <code>references</code> field of the document’s YAML metadata. The field should contain an array of YAML-encoded references, for example:</p>
<pre><code>---
references:
- type: article-journal
  id: WatsonCrick1953
  author:
  - family: Watson
    given: J. D.
  - family: Crick
    given: F. H. C.
  issued:
    date-parts:
    - - 1953
      - 4
      - 25
  title: &#39;Molecular structure of nucleic acids: a structure for deoxyribose
    nucleic acid&#39;
  title-short: Molecular structure of nucleic acids
  container-title: Nature
  volume: 171
  issue: 4356
  page: 737-738
  DOI: 10.1038/171737a0
  URL: http://www.nature.com/nature/journal/v171/n4356/abs/171737a0.html
  language: en-GB
...</code></pre>
<p>(<code>pandoc-citeproc --bib2yaml</code> can produce these from a bibliography file in one of the supported formats.)</p>
<p>Citations and references can be formatted using any style supported by the <a href="http://citationstyles.org">Citation Style Language</a>, listed in the <a href="https://www.zotero.org/styles">Zotero Style Repository</a>. These files are specified using the <code>--csl</code> option or the <code>csl</code> metadata field. By default, <code>pandoc-citeproc</code> will use the <a href="http://chicagomanualofstyle.org">Chicago Manual of Style</a> author-date format. The CSL project provides further information on <a href="http://citationstyles.org/styles/">finding and editing styles</a>.</p>
<p>To make your citations hyperlinks to the corresponding bibliography entries, add <code>link-citations: true</code> to your YAML metadata.</p>
<p>Citations go inside square brackets and are separated by semicolons. Each citation must have a key, composed of ‘@’ + the citation identifier from the database, and may optionally have a prefix, a locator, and a suffix. The citation key must begin with a letter, digit, or <code>_</code>, and may contain alphanumerics, <code>_</code>, and internal punctuation characters (<code>:.#$%&amp;-+?&lt;&gt;~/</code>). Here are some examples:</p>
<pre><code>Blah blah [see @doe99, pp. 33-35; also @smith04, chap. 1].

Blah blah [@doe99, pp. 33-35, 38-39 and *passim*].

Blah blah [@smith04; @doe99].</code></pre>
<p><code>pandoc-citeproc</code> detects locator terms in the <a href="https://github.com/citation-style-language/locales">CSL locale files</a>. Either abbreviated or unabbreviated forms are accepted. In the <code>en-US</code> locale, locator terms can be written in either singular or plural forms, as <code>book</code>, <code>bk.</code>/<code>bks.</code>; <code>chapter</code>, <code>chap.</code>/<code>chaps.</code>; <code>column</code>, <code>col.</code>/<code>cols.</code>; <code>figure</code>, <code>fig.</code>/<code>figs.</code>; <code>folio</code>, <code>fol.</code>/<code>fols.</code>; <code>number</code>, <code>no.</code>/<code>nos.</code>; <code>line</code>, <code>l.</code>/<code>ll.</code>; <code>note</code>, <code>n.</code>/<code>nn.</code>; <code>opus</code>, <code>op.</code>/<code>opp.</code>; <code>page</code>, <code>p.</code>/<code>pp.</code>; <code>paragraph</code>, <code>para.</code>/<code>paras.</code>; <code>part</code>, <code>pt.</code>/<code>pts.</code>; <code>section</code>, <code>sec.</code>/<code>secs.</code>; <code>sub verbo</code>, <code>s.v.</code>/<code>s.vv.</code>; <code>verse</code>, <code>v.</code>/<code>vv.</code>; <code>volume</code>, <code>vol.</code>/<code>vols.</code>; <code>¶</code>/<code>¶¶</code>; <code>§</code>/<code>§§</code>. If no locator term is used, “page” is assumed.</p>
<p>A minus sign (<code>-</code>) before the <code>@</code> will suppress mention of the author in the citation. This can be useful when the author is already mentioned in the text:</p>
<pre><code>Smith says blah [-@smith04].</code></pre>
<p>You can also write an in-text citation, as follows:</p>
<pre><code>@smith04 says blah.

@smith04 [p. 33] says blah.</code></pre>
<p>If the style calls for a list of works cited, it will be placed at the end of the document. Normally, you will want to end your document with an appropriate header:</p>
<pre><code>last paragraph...

# References</code></pre>
<p>The bibliography will be inserted after this header. Note that the <code>unnumbered</code> class will be added to this header, so that the section will not be numbered.</p>
<p>If you want to include items in the bibliography without actually citing them in the body text, you can define a dummy <code>nocite</code> metadata field and put the citations there:</p>
<pre><code>---
nocite: |
  @item1, @item2
...

@item3</code></pre>
<p>In this example, the document will contain a citation for <code>item3</code> only, but the bibliography will contain entries for <code>item1</code>, <code>item2</code>, and <code>item3</code>.</p>
<p>It is possible to create a bibliography with all the citations, whether or not they appear in the document, by using a wildcard:</p>
<pre><code>---
nocite: |
  @*
...</code></pre>
<p>For LaTeX or PDF output, you can also use <a href="https://ctan.org/pkg/natbib"><code>natbib</code></a> or <a href="https://ctan.org/pkg/biblatex"><code>biblatex</code></a> to render bibliography. In order to do so, specify bibliography files as outlined above, and add <code>--natbib</code> or <code>--biblatex</code> argument to <code>pandoc</code> invocation. Bear in mind that bibliography files have to be in respective format (either BibTeX or BibLaTeX).</p>
<p>For more information, see the <a href="https://github.com/jgm/pandoc-citeproc/blob/master/man/pandoc-citeproc.1.md">pandoc-citeproc man page</a>.</p>
<h2 id="non-pandoc-extensions">Non-pandoc extensions</h2>
<p>The following Markdown syntax extensions are not enabled by default in pandoc, but may be enabled by adding <code>+EXTENSION</code> to the format name, where <code>EXTENSION</code> is the name of the extension. Thus, for example, <code>markdown+hard_line_breaks</code> is Markdown with hard line breaks.</p>
<h4 id="extension-angle_brackets_escapable">Extension: <code>angle_brackets_escapable</code></h4>
<p>Allow <code>&lt;</code> and <code>&gt;</code> to be backslash-escaped, as they can be in GitHub flavored Markdown but not original Markdown. This is implied by pandoc’s default <code>all_symbols_escapable</code>.</p>
<h4 id="extension-lists_without_preceding_blankline">Extension: <code>lists_without_preceding_blankline</code></h4>
<p>Allow a list to occur right after a paragraph, with no intervening blank space.</p>
<h4 id="extension-hard_line_breaks">Extension: <code>hard_line_breaks</code></h4>
<p>Causes all newlines within a paragraph to be interpreted as hard line breaks instead of spaces.</p>
<h4 id="extension-ignore_line_breaks">Extension: <code>ignore_line_breaks</code></h4>
<p>Causes newlines within a paragraph to be ignored, rather than being treated as spaces or as hard line breaks. This option is intended for use with East Asian languages where spaces are not used between words, but text is divided into lines for readability.</p>
<h4 id="extension-east_asian_line_breaks">Extension: <code>east_asian_line_breaks</code></h4>
<p>Causes newlines within a paragraph to be ignored, rather than being treated as spaces or as hard line breaks, when they occur between two East Asian wide characters. This is a better choice than <code>ignore_line_breaks</code> for texts that include a mix of East Asian wide characters and other characters.</p>
<h5 id="extension-emoji">Extension: <code>emoji</code></h5>
<p>Parses textual emojis like <code>:smile:</code> as Unicode emoticons.</p>
<h4 id="extension-tex_math_single_backslash">Extension: <code>tex_math_single_backslash</code></h4>
<p>Causes anything between <code>\(</code> and <code>\)</code> to be interpreted as inline TeX math, and anything between <code>\[</code> and <code>\]</code> to be interpreted as display TeX math. Note: a drawback of this extension is that it precludes escaping <code>(</code> and <code>[</code>.</p>
<h4 id="extension-tex_math_double_backslash">Extension: <code>tex_math_double_backslash</code></h4>
<p>Causes anything between <code>\\(</code> and <code>\\)</code> to be interpreted as inline TeX math, and anything between <code>\\[</code> and <code>\\]</code> to be interpreted as display TeX math.</p>
<h4 id="extension-markdown_attribute">Extension: <code>markdown_attribute</code></h4>
<p>By default, pandoc interprets material inside block-level tags as Markdown. This extension changes the behavior so that Markdown is only parsed inside block-level tags if the tags have the attribute <code>markdown=1</code>.</p>
<h4 id="extension-mmd_title_block">Extension: <code>mmd_title_block</code></h4>
<p>Enables a <a href="http://fletcherpenney.net/multimarkdown/">MultiMarkdown</a> style title block at the top of the document, for example:</p>
<pre><code>Title:   My title
Author:  John Doe
Date:    September 1, 2008
Comment: This is a sample mmd title block, with
         a field spanning multiple lines.</code></pre>
<p>See the MultiMarkdown documentation for details. If <code>pandoc_title_block</code> or <code>yaml_metadata_block</code> is enabled, it will take precedence over <code>mmd_title_block</code>.</p>
<h4 id="extension-abbreviations">Extension: <code>abbreviations</code></h4>
<p>Parses PHP Markdown Extra abbreviation keys, like</p>
<pre><code>*[HTML]: Hypertext Markup Language</code></pre>
<p>Note that the pandoc document model does not support abbreviations, so if this extension is enabled, abbreviation keys are simply skipped (as opposed to being parsed as paragraphs).</p>
<h4 id="extension-autolink_bare_uris">Extension: <code>autolink_bare_uris</code></h4>
<p>Makes all absolute URIs into links, even when not surrounded by pointy braces <code>&lt;...&gt;</code>.</p>
<h4 id="extension-ascii_identifiers">Extension: <code>ascii_identifiers</code></h4>
<p>Causes the identifiers produced by <code>auto_identifiers</code> to be pure ASCII. Accents are stripped off of accented Latin letters, and non-Latin letters are omitted.</p>
<h4 id="extension-mmd_link_attributes">Extension: <code>mmd_link_attributes</code></h4>
<p>Parses multimarkdown style key-value attributes on link and image references. This extension should not be confused with the <a href="#extension-link_attributes"><code>link_attributes</code></a> extension.</p>
<pre><code>This is a reference ![image][ref] with multimarkdown attributes.

[ref]: http://path.to/image &quot;Image title&quot; width=20px height=30px
       id=myId class=&quot;myClass1 myClass2&quot;</code></pre>
<h4 id="extension-mmd_header_identifiers">Extension: <code>mmd_header_identifiers</code></h4>
<p>Parses multimarkdown style header identifiers (in square brackets, after the header but before any trailing <code>#</code>s in an ATX header).</p>
<h4 id="extension-compact_definition_lists">Extension: <code>compact_definition_lists</code></h4>
<p>Activates the definition list syntax of pandoc 1.12.x and earlier. This syntax differs from the one described above under <a href="#definition-lists">Definition lists</a> in several respects:</p>
<ul>
<li>No blank line is required between consecutive items of the definition list.</li>
<li>To get a “tight” or “compact” list, omit space between consecutive items; the space between a term and its definition does not affect anything.</li>
<li>Lazy wrapping of paragraphs is not allowed: the entire definition must be indented four spaces.<a href="#fn6" class="footnoteRef" id="fnref6"><sup>6</sup></a></li>
</ul>
<h2 id="markdown-variants">Markdown variants</h2>
<p>In addition to pandoc’s extended Markdown, the following Markdown variants are supported:</p>
<dl>
<dt><code>markdown_phpextra</code> (PHP Markdown Extra)</dt>
<dd><code>footnotes</code>, <code>pipe_tables</code>, <code>raw_html</code>, <code>markdown_attribute</code>, <code>fenced_code_blocks</code>, <code>definition_lists</code>, <code>intraword_underscores</code>, <code>header_attributes</code>, <code>link_attributes</code>, <code>abbreviations</code>, <code>shortcut_reference_links</code>.
</dd>
<dt><code>markdown_github</code> (GitHub-Flavored Markdown)</dt>
<dd><code>pipe_tables</code>, <code>raw_html</code>, <code>fenced_code_blocks</code>, <code>auto_identifiers</code>, <code>ascii_identifiers</code>, <code>backtick_code_blocks</code>, <code>autolink_bare_uris</code>, <code>intraword_underscores</code>, <code>strikeout</code>, <code>hard_line_breaks</code>, <code>emoji</code>, <code>shortcut_reference_links</code>, <code>angle_brackets_escapable</code>.
</dd>
<dt><code>markdown_mmd</code> (MultiMarkdown)</dt>
<dd><code>pipe_tables</code>, <code>raw_html</code>, <code>markdown_attribute</code>, <code>mmd_link_attributes</code>, <code>tex_math_double_backslash</code>, <code>intraword_underscores</code>, <code>mmd_title_block</code>, <code>footnotes</code>, <code>definition_lists</code>, <code>all_symbols_escapable</code>, <code>implicit_header_references</code>, <code>auto_identifiers</code>, <code>mmd_header_identifiers</code>, <code>shortcut_reference_links</code>.
</dd>
<dt><code>markdown_strict</code> (Markdown.pl)</dt>
<dd><code>raw_html</code>
</dd>
</dl>
<h2 id="extensions-with-formats-other-than-markdown">Extensions with formats other than Markdown</h2>
<p>Some of the extensions discussed above can be used with formats other than Markdown:</p>
<ul>
<li><p><code>auto_identifiers</code> can be used with <code>latex</code>, <code>rst</code>, <code>mediawiki</code>, and <code>textile</code> input (and is used by default).</p></li>
<li><p><code>tex_math_dollars</code>, <code>tex_math_single_backslash</code>, and <code>tex_math_double_backslash</code> can be used with <code>html</code> input. (This is handy for reading web pages formatted using MathJax, for example.)</p></li>
</ul>
<h1 id="producing-slide-shows-with-pandoc">Producing slide shows with pandoc</h1>
<p>You can use pandoc to produce an HTML + JavaScript slide presentation that can be viewed via a web browser. There are five ways to do this, using <a href="http://meyerweb.com/eric/tools/s5/">S5</a>, <a href="http://paulrouget.com/dzslides/">DZSlides</a>, <a href="http://www.w3.org/Talks/Tools/Slidy/">Slidy</a>, <a href="http://goessner.net/articles/slideous/">Slideous</a>, or <a href="http://lab.hakim.se/reveal-js/">reveal.js</a>. You can also produce a PDF slide show using LaTeX <a href="https://ctan.org/pkg/beamer"><code>beamer</code></a>.</p>
<p>Here’s the Markdown source for a simple slide show, <code>habits.txt</code>:</p>
<pre><code>% Habits
% John Doe
% March 22, 2005

# In the morning

## Getting up

- Turn off alarm
- Get out of bed

## Breakfast

- Eat eggs
- Drink coffee

# In the evening

## Dinner

- Eat spaghetti
- Drink wine

------------------

![picture of spaghetti](images/spaghetti.jpg)

## Going to sleep

- Get in bed
- Count sheep</code></pre>
<p>To produce an HTML/JavaScript slide show, simply type</p>
<pre><code>pandoc -t FORMAT -s habits.txt -o habits.html</code></pre>
<p>where <code>FORMAT</code> is either <code>s5</code>, <code>slidy</code>, <code>slideous</code>, <code>dzslides</code>, or <code>revealjs</code>.</p>
<p>For Slidy, Slideous, reveal.js, and S5, the file produced by pandoc with the <code>-s/--standalone</code> option embeds a link to JavaScript and CSS files, which are assumed to be available at the relative path <code>s5/default</code> (for S5), <code>slideous</code> (for Slideous), <code>reveal.js</code> (for reveal.js), or at the Slidy website at <code>w3.org</code> (for Slidy). (These paths can be changed by setting the <code>slidy-url</code>, <code>slideous-url</code>, <code>revealjs-url</code>, or <code>s5-url</code> variables; see <a href="#variables-for-slides">Variables for slides</a>, above.) For DZSlides, the (relatively short) JavaScript and CSS are included in the file by default.</p>
<p>With all HTML slide formats, the <code>--self-contained</code> option can be used to produce a single file that contains all of the data necessary to display the slide show, including linked scripts, stylesheets, images, and videos.</p>
<p>To produce a PDF slide show using beamer, type</p>
<pre><code>pandoc -t beamer habits.txt -o habits.pdf</code></pre>
<p>Note that a reveal.js slide show can also be converted to a PDF by printing it to a file from the browser.</p>
<h2 id="structuring-the-slide-show">Structuring the slide show</h2>
<p>By default, the <em>slide level</em> is the highest header level in the hierarchy that is followed immediately by content, and not another header, somewhere in the document. In the example above, level 1 headers are always followed by level 2 headers, which are followed by content, so 2 is the slide level. This default can be overridden using the <code>--slide-level</code> option.</p>
<p>The document is carved up into slides according to the following rules:</p>
<ul>
<li><p>A horizontal rule always starts a new slide.</p></li>
<li><p>A header at the slide level always starts a new slide.</p></li>
<li><p>Headers <em>below</em> the slide level in the hierarchy create headers <em>within</em> a slide.</p></li>
<li><p>Headers <em>above</em> the slide level in the hierarchy create “title slides,” which just contain the section title and help to break the slide show into sections.</p></li>
<li><p>A title page is constructed automatically from the document’s title block, if present. (In the case of beamer, this can be disabled by commenting out some lines in the default template.)</p></li>
</ul>
<p>These rules are designed to support many different styles of slide show. If you don’t care about structuring your slides into sections and subsections, you can just use level 1 headers for all each slide. (In that case, level 1 will be the slide level.) But you can also structure the slide show into sections, as in the example above.</p>
<p>Note: in reveal.js slide shows, if slide level is 2, a two-dimensional layout will be produced, with level 1 headers building horizontally and level 2 headers building vertically. It is not recommended that you use deeper nesting of section levels with reveal.js.</p>
<h2 id="incremental-lists">Incremental lists</h2>
<p>By default, these writers produce lists that display “all at once.” If you want your lists to display incrementally (one item at a time), use the <code>-i</code> option. If you want a particular list to depart from the default (that is, to display incrementally without the <code>-i</code> option and all at once with the <code>-i</code> option), put it in a block quote:</p>
<pre><code>&gt; - Eat spaghetti
&gt; - Drink wine</code></pre>
<p>In this way incremental and nonincremental lists can be mixed in a single document.</p>
<h2 id="inserting-pauses">Inserting pauses</h2>
<p>You can add “pauses” within a slide by including a paragraph containing three dots, separated by spaces:</p>
<pre><code># Slide with a pause

content before the pause

. . .

content after the pause</code></pre>
<h2 id="styling-the-slides">Styling the slides</h2>
<p>You can change the style of HTML slides by putting customized CSS files in <code>$DATADIR/s5/default</code> (for S5), <code>$DATADIR/slidy</code> (for Slidy), or <code>$DATADIR/slideous</code> (for Slideous), where <code>$DATADIR</code> is the user data directory (see <code>--data-dir</code>, above). The originals may be found in pandoc’s system data directory (generally <code>$CABALDIR/pandoc-VERSION/s5/default</code>). Pandoc will look there for any files it does not find in the user data directory.</p>
<p>For dzslides, the CSS is included in the HTML file itself, and may be modified there.</p>
<p>All <a href="https://github.com/hakimel/reveal.js#configuration">reveal.js configuration options</a> can be set through variables. For example, themes can be used by setting the <code>theme</code> variable:</p>
<pre><code>-V theme=moon</code></pre>
<p>Or you can specify a custom stylesheet using the <code>--css</code> option.</p>
<p>To style beamer slides, you can specify a <code>theme</code>, <code>colortheme</code>, <code>fonttheme</code>, <code>innertheme</code>, and <code>outertheme</code>, using the <code>-V</code> option:</p>
<pre><code>pandoc -t beamer habits.txt -V theme:Warsaw -o habits.pdf</code></pre>
<p>Note that header attributes will turn into slide attributes (on a <code>&lt;div&gt;</code> or <code>&lt;section&gt;</code>) in HTML slide formats, allowing you to style individual slides. In beamer, the only header attribute that affects slides is the <code>allowframebreaks</code> class, which sets the <code>allowframebreaks</code> option, causing multiple slides to be created if the content overfills the frame. This is recommended especially for bibliographies:</p>
<pre><code># References {.allowframebreaks}</code></pre>
<h2 id="speaker-notes">Speaker notes</h2>
<p>reveal.js has good support for speaker notes. You can add notes to your Markdown document thus:</p>
<pre><code>&lt;div class=&quot;notes&quot;&gt;
This is my note.

- It can contain Markdown
- like this list

&lt;/div&gt;</code></pre>
<p>To show the notes window, press <code>s</code> while viewing the presentation. Notes are not yet supported for other slide formats, but the notes will not appear on the slides themselves.</p>
<h2 id="frame-attributes-in-beamer">Frame attributes in beamer</h2>
<p>Sometimes it is necessary to add the LaTeX <code>[fragile]</code> option to a frame in beamer (for example, when using the <code>minted</code> environment). This can be forced by adding the <code>fragile</code> class to the header introducing the slide:</p>
<pre><code># Fragile slide {.fragile}</code></pre>
<p>All of the other frame attributes described in Section 8.1 of the <a href="http://ctan.math.utah.edu/ctan/tex-archive/macros/latex/contrib/beamer/doc/beameruserguide.pdf">Beamer User’s Guide</a> may also be used: <code>allowdisplaybreaks</code>, <code>allowframebreaks</code>, <code>b</code>, <code>c</code>, <code>t</code>, <code>environment</code>, <code>label</code>, <code>plain</code>, <code>shrink</code>.</p>
<h1 id="creating-epubs-with-pandoc">Creating EPUBs with pandoc</h1>
<h2 id="epub-metadata">EPUB Metadata</h2>
<p>EPUB metadata may be specified using the <code>--epub-metadata</code> option, but if the source document is Markdown, it is better to use a <a href="#extension-yaml_metadata_block">YAML metadata block</a>. Here is an example:</p>
<pre><code>---
title:
- type: main
  text: My Book
- type: subtitle
  text: An investigation of metadata
creator:
- role: author
  text: John Smith
- role: editor
  text: Sarah Jones
identifier:
- scheme: DOI
  text: doi:10.234234.234/33
publisher:  My Press
rights: © 2007 John Smith, CC BY-NC
...</code></pre>
<p>The following fields are recognized:</p>
<dl>
<dt><code>identifier</code></dt>
<dd>Either a string value or an object with fields <code>text</code> and <code>scheme</code>. Valid values for <code>scheme</code> are <code>ISBN-10</code>, <code>GTIN-13</code>, <code>UPC</code>, <code>ISMN-10</code>, <code>DOI</code>, <code>LCCN</code>, <code>GTIN-14</code>, <code>ISBN-13</code>, <code>Legal deposit number</code>, <code>URN</code>, <code>OCLC</code>, <code>ISMN-13</code>, <code>ISBN-A</code>, <code>JP</code>, <code>OLCC</code>.
</dd>
<dt><code>title</code></dt>
<dd>Either a string value, or an object with fields <code>file-as</code> and <code>type</code>, or a list of such objects. Valid values for <code>type</code> are <code>main</code>, <code>subtitle</code>, <code>short</code>, <code>collection</code>, <code>edition</code>, <code>extended</code>.
</dd>
<dt><code>creator</code></dt>
<dd>Either a string value, or an object with fields <code>role</code>, <code>file-as</code>, and <code>text</code>, or a list of such objects. Valid values for <code>role</code> are <a href="http://loc.gov/marc/relators/relaterm.html">MARC relators</a>, but pandoc will attempt to translate the human-readable versions (like “author” and “editor”) to the appropriate marc relators.
</dd>
<dt><code>contributor</code></dt>
<dd>Same format as <code>creator</code>.
</dd>
<dt><code>date</code></dt>
<dd>A string value in <code>YYYY-MM-DD</code> format. (Only the year is necessary.) Pandoc will attempt to convert other common date formats.
</dd>
<dt><code>lang</code> (or legacy: <code>language</code>)</dt>
<dd>A string value in <a href="https://tools.ietf.org/html/bcp47">BCP 47</a> format. Pandoc will default to the local language if nothing is specified.
</dd>
<dt><code>subject</code></dt>
<dd>A string value or a list of such values.
</dd>
<dt><code>description</code></dt>
<dd>A string value.
</dd>
<dt><code>type</code></dt>
<dd>A string value.
</dd>
<dt><code>format</code></dt>
<dd>A string value.
</dd>
<dt><code>relation</code></dt>
<dd>A string value.
</dd>
<dt><code>coverage</code></dt>
<dd>A string value.
</dd>
<dt><code>rights</code></dt>
<dd>A string value.
</dd>
<dt><code>cover-image</code></dt>
<dd>A string value (path to cover image).
</dd>
<dt><code>stylesheet</code></dt>
<dd>A string value (path to CSS stylesheet).
</dd>
<dt><code>page-progression-direction</code></dt>
<dd>Either <code>ltr</code> or <code>rtl</code>. Specifies the <code>page-progression-direction</code> attribute for the <a href="http://idpf.org/epub/301/spec/epub-publications.html#sec-spine-elem"><code>spine</code> element</a>.
</dd>
</dl>
<h2 id="linked-media">Linked media</h2>
<p>By default, pandoc will download linked media (including audio and video) and include it in the EPUB container, yielding a completely self-contained EPUB. If you want to link to external media resources instead, use raw HTML in your source and add <code>data-external=&quot;1&quot;</code> to the tag with the <code>src</code> attribute. For example:</p>
<pre><code>&lt;audio controls=&quot;1&quot;&gt;
  &lt;source src=&quot;http://example.com/music/toccata.mp3&quot;
          data-external=&quot;1&quot; type=&quot;audio/mpeg&quot;&gt;
  &lt;/source&gt;
&lt;/audio&gt;</code></pre>
<h1 id="literate-haskell-support">Literate Haskell support</h1>
<p>If you append <code>+lhs</code> (or <code>+literate_haskell</code>) to an appropriate input or output format (<code>markdown</code>, <code>markdown_strict</code>, <code>rst</code>, or <code>latex</code> for input or output; <code>beamer</code>, <code>html</code> or <code>html5</code> for output only), pandoc will treat the document as literate Haskell source. This means that</p>
<ul>
<li><p>In Markdown input, “bird track” sections will be parsed as Haskell code rather than block quotations. Text between <code>\begin{code}</code> and <code>\end{code}</code> will also be treated as Haskell code. For ATX-style headers the character ‘=’ will be used instead of ‘#’.</p></li>
<li><p>In Markdown output, code blocks with classes <code>haskell</code> and <code>literate</code> will be rendered using bird tracks, and block quotations will be indented one space, so they will not be treated as Haskell code. In addition, headers will be rendered setext-style (with underlines) rather than ATX-style (with ‘#’ characters). (This is because ghc treats ‘#’ characters in column 1 as introducing line numbers.)</p></li>
<li><p>In restructured text input, “bird track” sections will be parsed as Haskell code.</p></li>
<li><p>In restructured text output, code blocks with class <code>haskell</code> will be rendered using bird tracks.</p></li>
<li><p>In LaTeX input, text in <code>code</code> environments will be parsed as Haskell code.</p></li>
<li><p>In LaTeX output, code blocks with class <code>haskell</code> will be rendered inside <code>code</code> environments.</p></li>
<li><p>In HTML output, code blocks with class <code>haskell</code> will be rendered with class <code>literatehaskell</code> and bird tracks.</p></li>
</ul>
<p>Examples:</p>
<pre><code>pandoc -f markdown+lhs -t html</code></pre>
<p>reads literate Haskell source formatted with Markdown conventions and writes ordinary HTML (without bird tracks).</p>
<pre><code>pandoc -f markdown+lhs -t html+lhs</code></pre>
<p>writes HTML with the Haskell code in bird tracks, so it can be copied and pasted as literate Haskell source.</p>
<h1 id="syntax-highlighting">Syntax highlighting</h1>
<p>Pandoc will automatically highlight syntax in <a href="#fenced-code-blocks">fenced code blocks</a> that are marked with a language name. The Haskell library <a href="https://github.com/jgm/highlighting-kate">highlighting-kate</a> is used for highlighting, which works in HTML, Docx, and LaTeX/PDF output. To see a list of language names that pandoc will recognize, type <code>pandoc --list-highlight-languages</code>.</p>
<p>The color scheme can be selected using the <code>--highlight-style</code> option. The default color scheme is <code>pygments</code>, which imitates the default color scheme used by the Python library pygments (though pygments is not actually used to do the highlighting). To see a list of highlight styles, type <code>pandoc --list-highlight-styles</code>.</p>
<p>To disable highlighting, use the <code>--no-highlight</code> option.</p>
<h1 id="custom-styles-in-docx-output">Custom Styles in Docx Output</h1>
<p>By default, pandoc’s docx output applies a predefined set of styles for blocks such as paragraphs and block quotes, and uses largely default formatting (italics, bold) for inlines. This will work for most purposes, especially alongside a <code>reference.docx</code> file. However, if you need to apply your own styles to blocks, or match a preexisting set of styles, pandoc allows you to define custom styles for blocks and text using <code>div</code>s and <code>span</code>s, respectively.</p>
<p>If you define a <code>div</code> or <code>span</code> with the attribute <code>custom-style</code>, pandoc will apply your specified style to the contained elements. So, for example,</p>
<pre><code>&lt;span custom-style=&quot;Emphatically&quot;&gt;Get out,&lt;/span&gt; he said.</code></pre>
<p>would produce a docx file with “Get out,” styled with character style <code>Emphatically</code>. Similarly,</p>
<pre><code>Dickinson starts the poem simply:

&lt;div custom-style=&quot;Poetry&quot;&gt;
| A Bird came down the Walk---
| He did not know I saw---
&lt;/div&gt;</code></pre>
<p>would style the two contained lines with the <code>Poetry</code> paragraph style.</p>
<p>If the styles are not yet in your reference.docx, they will be defined in the output file as inheriting from normal text. If they are already defined, pandoc will not alter the definition.</p>
<p>This feature allows for greatest customization in conjunction with <a href="http://pandoc.org/scripting.html">pandoc filters</a>. If you want all paragraphs after block quotes to be indented, you can write a filter to apply the styles necessary. If you want all italics to be transformed to the <code>Emphasis</code> character style (perhaps to change their color), you can write a filter which will transform all italicized inlines to inlines within an <code>Emphasis</code> custom-style <code>span</code>.</p>
<h1 id="custom-writers">Custom writers</h1>
<p>Pandoc can be extended with custom writers written in <a href="http://www.lua.org">lua</a>. (Pandoc includes a lua interpreter, so lua need not be installed separately.)</p>
<p>To use a custom writer, simply specify the path to the lua script in place of the output format. For example:</p>
<pre><code>pandoc -t data/sample.lua</code></pre>
<p>Creating a custom writer requires writing a lua function for each possible element in a pandoc document. To get a documented example which you can modify according to your needs, do</p>
<pre><code>pandoc --print-default-data-file sample.lua</code></pre>
<h1 id="authors">Authors</h1>
<p>© 2006-2016 John MacFarlane (jgm@berkeley.edu). Released under the <a href="http://www.gnu.org/copyleft/gpl.html" title="GNU General Public License">GPL</a>, version 2 or greater. This software carries no warranty of any kind. (See COPYRIGHT for full copyright and warranty notices.)</p>
<p>Contributors include Arata Mizuki, Aaron Wolen, Albert Krewinkel, Alex Ivkin, Alex Vong, Alexander Kondratskiy, Alexander Sulfrian, Alexander V Vershilov, Alfred Wechselberger, Andreas Lööw, Andrew Dunning, Antoine Latter, Arata Mizuki, Arlo O’Keeffe, Artyom Kazak, B. Scott Michel, Ben Gamari, Beni Cherniavsky-Paskin, Benoit Schweblin, Bjorn Buckwalter, Bradley Kuhn, Brent Yorgey, Bryan O’Sullivan, Caleb McDaniel, Calvin Beck, Carlos Sosa, Chris Black, Christian Conkle, Christoffer Ackelman, Christoffer Sawicki, Clare Macrae, Clint Adams, Conal Elliott, Craig S. Bosma, Daniel Bergey, Daniel T. Staal, Daniele D’Orazio, David Lazar, David Röthlisberger, Denis Laxalde, Douglas Calvert, Emanuel Evans, Emily Eisenberg, Eric Kow, Eric Seidel, Felix Yan, Florian Eitel, François Gannaz, Freiric Barral, Freirich Raabe, Frerich Raabe, Fyodor Sheremetyev, Gabor Pali, Gavin Beatty, Gottfried Haider, Greg Maslov, Greg Rundlett, Grégory Bataille, Gwern Branwen, Hans-Peter Deifel, Henrik Tramberend, Henry de Valence, Hubert Plociniczak, Ilya V. Portnov, Ivo Clarysse, J. Lewis Muir, Jaime Marquínez Ferrándiz, Jakob Voß, James Aspnes, Jamie F. Olson, Jan Larres, Jan Schulz, Jason Ronallo, Jeff Arnold, Jeff Runningen, Jens Petersen, Jesse Rosenthal, Joe Hillenbrand, John MacFarlane, John Muccigrosso, Jonas Smedegaard, Jonathan Daugherty, Jose Luis Duran, Josef Svenningsson, Julien Cretel, Juliusz Gonera, Justin Bogner, Jérémy Bobbio, Kelsey Hightower, Kolen Cheung, Konstantin Zudov, Kristof Bastiaensen, Lars-Dominik Braun, Luke Plant, Mark Szepieniec, Mark Wright, Martin Linn, Masayoshi Takahashi, Matej Kollar, Mathias Schenner, Mathieu Duponchelle, Matthew Eddey, Matthew Pickering, Matthias C. M. Troffaes, Mauro Bieg, Max Bolingbroke, Max Rydahl Andersen, Merijn Verstraaten, Michael Beaumont, Michael Chladek, Michael Snoyman, Michael Thompson, MinRK, Morton Fox, Nathan Gass, Neil Mayhew, Nick Bart, Nicolas Kaiser, Nikolay Yakimov, Oliver Matthews, Ophir Lifshitz, Pablo Rodríguez, Paul Rivier, Paulo Tanimoto, Peter Wang, Philippe Ombredanne, Phillip Alday, Prayag Verma, Puneeth Chaganti, Ralf Stephan, Raniere Silva, Recai Oktaş, RyanGlScott, Scott Morrison, Sergei Trofimovich, Sergey Astanin, Shahbaz Youssefi, Shaun Attfield, Sidarth Kapur, Sidharth Kapur, Simon Hengel, Sumit Sahrawat, Thomas Hodgson, Thomas Weißschuh, Tim Lin, Timothy Humphries, Tiziano Müller, Todd Sifleet, Tom Leese, Uli Köhler, Václav Zeman, Viktor Kronvall, Vincent, Václav Haisman, Václav Zeman, Wandmalfarbe, Waldir Pimenta, Wikiwide, Xavier Olive, bumper314, csforste, infinity0x, nkalvi, qerub, robabla, roblabla, rodja.trappe, rski, shreevatsa.public, takahashim, tgkokk, thsutton.</p>
<div class="footnotes">
<hr />
<ol>
<li id="fn1"><p>To make <code>subtitle</code> work with other LaTeX document classes, you can add the following to <code>header-includes</code>:</p>
<pre><code>\providecommand{\subtitle}[1]{%
  \usepackage{titling}
  \posttitle{%
    \par\large#1\end{center}}
}</code></pre>
<a href="#fnref1">↩</a></li>
<li id="fn2"><p>The point of this rule is to ensure that normal paragraphs starting with people’s initials, like</p>
<pre><code>B. Russell was an English philosopher.</code></pre>
<p>do not get treated as list items.</p>
<p>This rule will not prevent</p>
<pre><code>(C) 2007 Joe Smith</code></pre>
<p>from being interpreted as a list item. In this case, a backslash escape can be used:</p>
<pre><code>(C\) 2007 Joe Smith</code></pre>
<a href="#fnref2">↩</a></li>
<li id="fn3"><p>I have been influenced by the suggestions of <a href="http://www.justatheory.com/computers/markup/modest-markdown-proposal.html">David Wheeler</a>.<a href="#fnref3">↩</a></p></li>
<li id="fn4"><p>This scheme is due to Michel Fortin, who proposed it on the <a href="http://six.pairlist.net/pipermail/markdown-discuss/2005-March/001097.html">Markdown discussion list</a>.<a href="#fnref4">↩</a></p></li>
<li id="fn5"><p>This feature is not yet implemented for RTF, OpenDocument, or ODT. In those formats, you’ll just get an image in a paragraph by itself, with no caption.<a href="#fnref5">↩</a></p></li>
<li id="fn6"><p>To see why laziness is incompatible with relaxing the requirement of a blank line between items, consider the following example:</p>
<pre><code>bar
:    definition
foo
:    definition</code></pre>
<p>Is this a single list item with two definitions of “bar,” the first of which is lazily wrapped, or two list items? To remove the ambiguity we must either disallow lazy wrapping or require a blank line between list items.<a href="#fnref6">↩</a></p></li>
</ol>
</div>
</body>
</html>
